Changeset 507 in dev for trunk/ab5.0


Ignore:
Timestamp:
Apr 28, 2008, 8:14:31 PM (16 years ago)
Author:
dai_9181
Message:

NamespaceSupporterクラスをab_commonプロジェクトに移動した。

Location:
trunk/ab5.0/abdev
Files:
15 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/BasicCompiler_Common/Compile.cpp

    r485 r507  
    44#include <CodeGenerator.h>
    55#include <Compiler.h>
    6 #include <NamespaceSupporter.h>
    76
    87#include "../BasicCompiler_Common/common.h"
  • trunk/ab5.0/abdev/BasicCompiler_Common/Subroutine.cpp

    r485 r507  
    33#include <Compiler.h>
    44#include <Procedure.h>
    5 #include <NamespaceSupporter.h>
    65
    76#include "../BasicCompiler_Common/common.h"
  • trunk/ab5.0/abdev/BasicCompiler_Common/VariableOpe.cpp

    r485 r507  
    44#include <LexicalScope.h>
    55#include <Variable.h>
    6 #include <NamespaceSupporter.h>
    76
    87#include "../BasicCompiler_Common/common.h"
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/Compiler.h

    r504 r507  
    33#include <Messenger.h>
    44#include <CodeGenerator.h>
    5 #include <NamespaceSupporter.h>
    65#include <Meta.h>
    76#include <DataTable.h>
     
    126125    {
    127126        pNowObjectModule = &objectModule;
     127
     128        namespaceSupporter.RegistAllNamespaceScopesCollection( &GetObjectModule().meta.GetNamespaces() );
    128129    }
    129130
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Class.cpp

    r485 r507  
    44#include <Class.h>
    55#include <Compiler.h>
    6 #include <NamespaceSupporter.h>
    76
    87#include "../common.h"
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Class_Collect.cpp

    r485 r507  
    44#include <Class.h>
    55#include <Compiler.h>
    6 #include <NamespaceSupporter.h>
    76
    87#include "../common.h"
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/ObjectModule.cpp

    r505 r507  
    4444#include <abdev/ab_common/Environment.h>
    4545#include <abdev/ab_common/include/Namespace.h>
     46#include <abdev/ab_common/include/NamespaceSupporter.h>
    4647
    4748using namespace ActiveBasic::Common::Lexical;
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Procedure.cpp

    r485 r507  
    33#include <Compiler.h>
    44#include <Procedure.h>
    5 #include <NamespaceSupporter.h>
    65
    76#include "../common.h"
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/TypeDef.cpp

    r465 r507  
    33#include <TypeDef.h>
    44#include <Compiler.h>
    5 #include <NamespaceSupporter.h>
    65
    76TypeDef::TypeDef( const NamespaceScopes &namespaceScopes, const string &name, const string &baseName, int nowLine )
  • trunk/ab5.0/abdev/ab_common/ab_common.vcproj

    r505 r507  
    320320                    >
    321321                </File>
     322                <File
     323                    RelativePath=".\include\NamespaceSupporter.h"
     324                    >
     325                </File>
    322326            </Filter>
    323327        </Filter>
     
    340344                <File
    341345                    RelativePath=".\src\Namespace.cpp"
     346                    >
     347                </File>
     348                <File
     349                    RelativePath=".\src\NamespaceSupporter.cpp"
    342350                    >
    343351                </File>
  • trunk/ab5.0/abdev/ab_common/include/Namespace.h

    r505 r507  
    11#pragma once
    2 
    3 #include <vector>
    4 #include <string>
    5 #include <boost/foreach.hpp>
    62
    73
  • trunk/ab5.0/abdev/ab_common/include/NamespaceSupporter.h

    r506 r507  
    11#pragma once
     2
     3namespace ActiveBasic{ namespace Common{ namespace Lexical{
     4
    25
    36class NamespaceSupporter
    47{
     8    const NamespaceScopesCollection *allNamespaceScopesCollection;
     9
    510    // Importsされた名前空間
    611    NamespaceScopesCollection importedNamespaces;
     
    1015
    1116public:
     17    NamespaceSupporter()
     18        : allNamespaceScopesCollection( NULL )
     19    {
     20    }
     21
     22    void RegistAllNamespaceScopesCollection( const NamespaceScopesCollection *allNamespaceScopesCollection )
     23    {
     24        this->allNamespaceScopesCollection = allNamespaceScopesCollection;
     25    }
     26
    1227    NamespaceScopesCollection &GetImportedNamespaces()
    1328    {
     
    1833        this->importedNamespaces = namespaces;
    1934    }
     35    bool ImportsNamespace( const NamespaceScopes &namespaceScopes );
    2036    bool ImportsNamespace( const std::string &namespaceStr );
    2137
     
    4056    // entryName =   "ActiveBasic"
    4157    // この場合、living は entryName を包括している。
    42     bool IsCoverd( const NamespaceScopes &namespaceScopes, const string &entryName ) const
     58    bool IsCoverd( const NamespaceScopes &namespaceScopes, const std::string &entryName ) const
    4359    {
    44         if( namespaceScopes.IsEqual( entryName ) ){
     60        if( namespaceScopes.IsEqual( entryName ) )
     61        {
    4562            return true;
    4663        }
    4764
    48         string thisStr = namespaceScopes.ToString();
     65        std::string thisStr = namespaceScopes.ToString();
    4966
    5067        NamespaceScopes tempLivingNamespaceScopes = livingNamespaceScopes;
    5168
    52         while( tempLivingNamespaceScopes.size() ){
    53             string tempStr = tempLivingNamespaceScopes.ToString() + "." + entryName;
    54             if( thisStr == tempStr ){
     69        while( tempLivingNamespaceScopes.size() )
     70        {
     71            std::string tempStr = tempLivingNamespaceScopes.ToString() + "." + entryName;
     72            if( thisStr == tempStr )
     73            {
    5574                return true;
    5675            }
     
    98117    }
    99118};
     119
     120
     121}}}
  • trunk/ab5.0/abdev/ab_common/src/NamespaceSupporter.cpp

    r506 r507  
    11#include "stdafx.h"
    22
    3 #include <Compiler.h>
     3using namespace ActiveBasic::Common::Lexical;
    44
    5 bool NamespaceSupporter::ImportsNamespace( const std::string &namespaceStr )
     5bool NamespaceSupporter::ImportsNamespace( const NamespaceScopes &namespaceScopes )
    66{
    7     NamespaceScopes namespaceScopes( namespaceStr );
    8     if( !compiler.GetObjectModule().meta.GetNamespaces().IsExist( namespaceScopes ) ){
     7    if( !allNamespaceScopesCollection->IsExist( namespaceScopes ) ){
    98        return false;
    109    }
     
    1413    return true;
    1514}
     15
     16bool NamespaceSupporter::ImportsNamespace( const std::string &namespaceStr )
     17{
     18    NamespaceScopes namespaceScopes( namespaceStr );
     19
     20    return ImportsNamespace( namespaceScopes );
     21}
  • trunk/ab5.0/abdev/ab_common/stdafx.h

    r505 r507  
    3434
    3535#include <Namespace.h>
     36#include <NamespaceSupporter.h>
  • trunk/ab5.0/abdev/compiler_x86/Compile_ProcOp.cpp

    r465 r507  
    66#include <Class.h>
    77#include <Variable.h>
    8 #include <NamespaceSupporter.h>
    98
    109#include "../BasicCompiler_Common/common.h"
  • trunk/ab5.0/abdev/compiler_x86/compiler_x86.vcproj

    r506 r507  
    13081308                    </File>
    13091309                    <File
    1310                         RelativePath="..\BasicCompiler_Common\src\NamespaceSupporter.cpp"
    1311                         >
    1312                     </File>
    1313                     <File
    13141310                        RelativePath="..\BasicCompiler_Common\src\NativeCode.cpp"
    13151311                        >
     
    15211517                    </File>
    15221518                    <File
    1523                         RelativePath="..\BasicCompiler_Common\include\NamespaceSupporter.h"
    1524                         >
    1525                     </File>
    1526                     <File
    15271519                        RelativePath="..\BasicCompiler_Common\include\NativeCode.h"
    15281520                        >
  • trunk/ab5.0/abdev/compiler_x86/stdafx.h

    r506 r507  
    3333#include <abdev/ab_common/Environment.h>
    3434#include <abdev/ab_common/include/Namespace.h>
     35#include <abdev/ab_common/include/NamespaceSupporter.h>
    3536
    3637using namespace ActiveBasic::Common::Lexical;
Note: See TracChangeset for help on using the changeset viewer.