source: dev/BasicCompiler_Common/Variable.cpp@ 103

Last change on this file since 103 was 103, checked in by dai_9181, 17 years ago

名前空間機能をグローバル変数、定数と列挙型に適用。
一部、クラスの静的メンバと名前空間の相性が悪いコードが潜んでいるため、要改修

File size: 950 bytes
Line 
1#include "common.h"
2
3bool Variable::IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const
4{
5 if( GetName() != name ){
6 return false;
7 }
8 return NamespaceScopes::IsSameArea( this->namespaceScopes, namespaceScopes );
9}
10bool 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 ) ){
17 return true;
18 }
19
20 if( isNest ){
21 // 静的メンバを考慮
22
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 );
30 }
31
32 return false;
33}
Note: See TracBrowser for help on using the repository browser.