Last change
on this file since 519 was 516, checked in by dai_9181, 16 years ago |
ab_commonプロジェクト内にLexicalディレクトリを作成。
|
File size:
1.0 KB
|
Rev | Line | |
---|
[206] | 1 | #include "stdafx.h"
|
---|
| 2 |
|
---|
[509] | 3 | using namespace ActiveBasic::Common::Lexical;
|
---|
[206] | 4 |
|
---|
[504] | 5 | const NamespaceSupporter *Symbol::namespaceSupporter = NULL;
|
---|
| 6 |
|
---|
[348] | 7 | std::string Symbol::GetFullName() const
|
---|
| 8 | {
|
---|
| 9 | if( namespaceScopes.size() )
|
---|
| 10 | {
|
---|
| 11 | return namespaceScopes.ToString() + "." + name;
|
---|
| 12 | }
|
---|
| 13 |
|
---|
| 14 | return name;
|
---|
| 15 | }
|
---|
| 16 |
|
---|
[509] | 17 | bool Symbol::IsEqualSymbol( const NamespaceScopes &namespaceScopes, const std::string &name ) const
|
---|
[206] | 18 | {
|
---|
| 19 | if( GetName() != name ){
|
---|
| 20 | return false;
|
---|
| 21 | }
|
---|
| 22 |
|
---|
[504] | 23 | _ASSERTE( namespaceSupporter );
|
---|
| 24 | return namespaceSupporter->IsSameAreaNamespace( GetNamespaceScopes(), namespaceScopes );
|
---|
[206] | 25 | }
|
---|
| 26 | bool Symbol::IsEqualSymbol( const Symbol &symbol ) const
|
---|
| 27 | {
|
---|
| 28 | if( IsEqualSymbol( symbol.GetNamespaceScopes(), symbol.GetName() ) )
|
---|
| 29 | {
|
---|
| 30 | return true;
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 | if( symbol.GetNamespaceScopes().size() >= 1 )
|
---|
| 34 | {
|
---|
| 35 | // 静的メンバを考慮
|
---|
| 36 | NamespaceScopes namespaceScopes( symbol.GetNamespaceScopes() );
|
---|
[509] | 37 | std::string name = namespaceScopes[namespaceScopes.size()-1] + "." + symbol.GetName();
|
---|
[206] | 38 | namespaceScopes.pop_back();
|
---|
| 39 |
|
---|
| 40 | return IsEqualSymbol( namespaceScopes, name );
|
---|
| 41 | }
|
---|
| 42 | return false;
|
---|
| 43 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.