|
Last change
on this file since 585 was 516, checked in by dai_9181, 18 years ago |
|
ab_commonプロジェクト内にLexicalディレクトリを作成。
|
|
File size:
1.0 KB
|
| Line | |
|---|
| 1 | #include "stdafx.h"
|
|---|
| 2 |
|
|---|
| 3 | using namespace ActiveBasic::Common::Lexical;
|
|---|
| 4 |
|
|---|
| 5 | const NamespaceSupporter *Symbol::namespaceSupporter = NULL;
|
|---|
| 6 |
|
|---|
| 7 | std::string Symbol::GetFullName() const
|
|---|
| 8 | {
|
|---|
| 9 | if( namespaceScopes.size() )
|
|---|
| 10 | {
|
|---|
| 11 | return namespaceScopes.ToString() + "." + name;
|
|---|
| 12 | }
|
|---|
| 13 |
|
|---|
| 14 | return name;
|
|---|
| 15 | }
|
|---|
| 16 |
|
|---|
| 17 | bool Symbol::IsEqualSymbol( const NamespaceScopes &namespaceScopes, const std::string &name ) const
|
|---|
| 18 | {
|
|---|
| 19 | if( GetName() != name ){
|
|---|
| 20 | return false;
|
|---|
| 21 | }
|
|---|
| 22 |
|
|---|
| 23 | _ASSERTE( namespaceSupporter );
|
|---|
| 24 | return namespaceSupporter->IsSameAreaNamespace( GetNamespaceScopes(), namespaceScopes );
|
|---|
| 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() );
|
|---|
| 37 | std::string name = namespaceScopes[namespaceScopes.size()-1] + "." + symbol.GetName();
|
|---|
| 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.