Changeset 140 in dev for BasicCompiler_Common/Variable.cpp
- Timestamp:
- Jun 15, 2007, 4:00:25 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/Variable.cpp
r103 r140 1 1 #include "common.h" 2 2 3 bool Variable::IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name) const3 bool Variable::IsEqualSymbol( const Symbol &symbol, bool isSupportStaticMember ) const 4 4 { 5 if( GetName() != name ){ 6 return false; 7 } 8 return NamespaceScopes::IsSameArea( this->namespaceScopes, namespaceScopes ); 9 } 10 bool Variable::IsEqualSymbol( const string &fullName ) const 11 { 12 char AreaName[VN_SIZE] = ""; //オブジェクト変数 13 char NestName[VN_SIZE] = ""; //入れ子メンバ 14 bool isNest = SplitMemberName( fullName.c_str(), AreaName, NestName ); 15 16 if( IsEqualSymbol( NamespaceScopes( AreaName ), NestName ) ){ 5 if( GetName() == symbol.GetName() 6 && NamespaceScopes::IsSameArea( this->namespaceScopes, symbol.GetNamespaceScopes() ) ) 7 { 17 8 return true; 18 9 } 19 10 20 if( isNest ){ 11 if( isSupportStaticMember && symbol.GetNamespaceScopes().size() >= 1 ) 12 { 21 13 // 静的メンバを考慮 14 NamespaceScopes namespaceScopes( symbol.GetNamespaceScopes() ); 15 string name = namespaceScopes[namespaceScopes.size()-1] + "." + symbol.GetName(); 16 namespaceScopes.pop_back(); 22 17 23 char AreaName2[VN_SIZE] = ""; //オブジェクト変数 24 char NestName2[VN_SIZE] = ""; //入れ子メンバ 25 bool isNest = SplitMemberName( AreaName, AreaName2, NestName2 ); 26 lstrcat( NestName2, "." ); 27 lstrcat( NestName2, NestName ); 28 29 return IsEqualSymbol( NamespaceScopes( AreaName2 ), NestName2 ); 18 return IsEqualSymbol( Symbol( namespaceScopes, name ), false ); 30 19 } 31 32 20 return false; 33 21 }
Note:
See TracChangeset
for help on using the changeset viewer.