#include bool Variable::IsEqualSymbol( const Symbol &symbol, bool isSupportStaticMember ) const { if( GetName() == symbol.GetName() && NamespaceScopes::IsSameArea( this->namespaceScopes, symbol.GetNamespaceScopes() ) ) { return true; } if( isSupportStaticMember && symbol.GetNamespaceScopes().size() >= 1 ) { // 静的メンバを考慮 NamespaceScopes namespaceScopes( symbol.GetNamespaceScopes() ); string name = namespaceScopes[namespaceScopes.size()-1] + "." + symbol.GetName(); namespaceScopes.pop_back(); return IsEqualSymbol( Symbol( namespaceScopes, name ), false ); } return false; } bool Variables::DuplicateCheck( const Symbol &symbol ) const { //レキシカルスコープを考慮して重複判定 for( int i=(int)this->size()-1; i>=0 ; i-- ){ Variable &var = *(*this)[i]; if( var.bLiving //現在のスコープで有効なもの && var.ScopeLevel == obj_LexScopes.GetNowLevel() //現在のスコープと同一レベル ){ if( var.IsEqualSymbol( symbol ) ){ return true; } } } return false; } const Variables::Variable *BackSearch( const Symbol &symbol ) const { //レキシカルスコープを考慮してバックサーチ for( int i=(int)this->size()-1; i>=0 ; i-- ){ Variable &var = *(*this)[i]; if( var.bLiving //現在のスコープで有効なもの && var.ScopeLevel <= obj_LexScopes.GetNowLevel() //現在のスコープレベルを超さないもの(Returnによる解放処理中を考慮) ){ if( var.IsEqualSymbol( symbol ) ){ return &var; } } } return NULL; } const Variables::Variable *Find( const Symbol &symbol )const { int max = (int)this->size(); for( int i=0; iIsEqualSymbol( symbol ) ){ return pVar; } } return NULL; }