Ignore:
Timestamp:
Apr 25, 2007, 4:19:28 AM (17 years ago)
Author:
dai_9181
Message:

名前空間機能をグローバル関数に適用(作業完了)。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler_Common/Procedure.cpp

    r100 r101  
    370370    return ( pMethod->bVirtual != 0 );
    371371}
    372 bool UserProc::EqualName( const string &name ) const
     372const NamespaceScopes &UserProc::GetNamespaceScopes() const
     373{
     374    if( !pParentClass ){
     375        SetError();
     376    }
     377    return pParentClass->GetNamespaceScopes();
     378}
     379bool UserProc::IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const
    373380{
    374381    SetError();
    375     return true;
     382    return false;
    376383}
    377384
     
    503510    return true;
    504511}
    505 bool GlobalProc::EqualName( const string &name ) const
     512bool GlobalProc::IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const
    506513{
    507     char AreaName[VN_SIZE];     //オブジェクト変数
    508     char NestName[VN_SIZE];     //入れ子メンバ
    509     bool isNest = SplitMemberName( name.c_str(), AreaName, NestName );
    510 
    511     if( isNest ){
    512         if( GetNamespaceScopes().Equal( AreaName ) ){
    513             if( GetName() == NestName ){
     514    if( namespaceScopes.size() ){
     515        if( GetNamespaceScopes().IsCoverd( namespaceScopes ) ){
     516            if( GetName() == name ){
    514517                return true;
    515518            }
     
    519522        if( GetNamespaceScopes().size() ){
    520523            // 名前空間の判断が必要なとき
    521             if( !GetNamespaceScopes().IsUsing() ){
     524            if( !GetNamespaceScopes().IsUsing()
     525                && !GetNamespaceScopes().IsLiving() ){
    522526                // この名前空間は暗黙的に参照できないとき
    523527                return false;
    524528            }
    525529        }
    526         if( GetName() == name ){
    527             return true;
     530        else{
     531            if( GetName() == name ){
     532                return true;
     533            }
    528534        }
    529535    }
    530536
    531537    return false;
     538}
     539bool GlobalProc::IsEqualSymbol( const GlobalProc &globalProc ) const
     540{
     541    return IsEqualSymbol( globalProc.GetNamespaceScopes(), globalProc.GetName() );
     542}
     543bool GlobalProc::IsEqualSymbol( const string &fullName ) const
     544{
     545    char AreaName[VN_SIZE] = "";        //オブジェクト変数
     546    char NestName[VN_SIZE] = "";        //入れ子メンバ
     547    bool isNest = SplitMemberName( fullName.c_str(), AreaName, NestName );
     548
     549    return IsEqualSymbol( NamespaceScopes( AreaName ), NestName );
    532550}
    533551
Note: See TracChangeset for help on using the changeset viewer.