|
Last change
on this file since 669 was 669, checked in by dai_9181, 17 years ago |
|
NamespaceScopes::IsEqualを高速化した(他、リファクタリング)。
|
|
File size:
1.2 KB
|
| Line | |
|---|
| 1 | #include "stdafx.h"
|
|---|
| 2 |
|
|---|
| 3 | using namespace ActiveBasic::Common::Lexical;
|
|---|
| 4 |
|
|---|
| 5 | bool NamespaceSupporter::ImportsNamespace( const NamespaceScopes &namespaceScopes )
|
|---|
| 6 | {
|
|---|
| 7 | _ASSERT( allNamespaceScopesCollection );
|
|---|
| 8 | if( !allNamespaceScopesCollection->IsExist( namespaceScopes ) ){
|
|---|
| 9 | return false;
|
|---|
| 10 | }
|
|---|
| 11 |
|
|---|
| 12 | this->importedNamespaces.push_back( namespaceScopes );
|
|---|
| 13 |
|
|---|
| 14 | return true;
|
|---|
| 15 | }
|
|---|
| 16 |
|
|---|
| 17 | bool NamespaceSupporter::ImportsNamespace( const std::string &namespaceStr )
|
|---|
| 18 | {
|
|---|
| 19 | NamespaceScopes namespaceScopes( namespaceStr );
|
|---|
| 20 |
|
|---|
| 21 | return ImportsNamespace( namespaceScopes );
|
|---|
| 22 | }
|
|---|
| 23 |
|
|---|
| 24 | bool NamespaceSupporter::IsSameAreaNamespace( const NamespaceScopes &baseNamespaceScopes, const NamespaceScopes &entryNamespaceScopes ) const
|
|---|
| 25 | {
|
|---|
| 26 | if( entryNamespaceScopes.size() )
|
|---|
| 27 | {
|
|---|
| 28 | if( IsCoverd( baseNamespaceScopes, entryNamespaceScopes ) )
|
|---|
| 29 | {
|
|---|
| 30 | // 包括しているときは同一と見なす
|
|---|
| 31 | return true;
|
|---|
| 32 | }
|
|---|
| 33 | }
|
|---|
| 34 | else{
|
|---|
| 35 | if( baseNamespaceScopes.size() )
|
|---|
| 36 | {
|
|---|
| 37 | // 名前空間の判断が必要なとき
|
|---|
| 38 | if( this->importedNamespaces.IsImported( baseNamespaceScopes )
|
|---|
| 39 | || IsLiving( baseNamespaceScopes ) )
|
|---|
| 40 | {
|
|---|
| 41 | // Using指定があるとき
|
|---|
| 42 | // または
|
|---|
| 43 | // 指定された名前空間が現在の名前空間スコープと同一のとき
|
|---|
| 44 | return true;
|
|---|
| 45 | }
|
|---|
| 46 | }
|
|---|
| 47 | else{
|
|---|
| 48 | return true;
|
|---|
| 49 | }
|
|---|
| 50 | }
|
|---|
| 51 |
|
|---|
| 52 | return false;
|
|---|
| 53 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.