Changeset 504 in dev


Ignore:
Timestamp:
Apr 28, 2008, 7:04:16 PM (16 years ago)
Author:
dai_9181
Message:

Symbol::RegistNamespaceSupporterメソッドを追加。

Location:
trunk/ab5.0/abdev/BasicCompiler_Common
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/Compiler.h

    r472 r504  
    5858        , isCore( false )
    5959    {
     60        Symbol::RegistNamespaceSupporter( &namespaceSupporter );
    6061    }
    6162    ~Compiler()
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/NamespaceSupporter.h

    r355 r504  
    6969
    7070    // 指定された名前空間が同一エリアと見なされるかどうかをチェック
    71     bool IsSameAreaNamespace( const NamespaceScopes &baseNamespaceScopes, const NamespaceScopes &entryNamespaceScopes ){
    72         if( entryNamespaceScopes.size() ){
    73             if( IsCoverd( baseNamespaceScopes, entryNamespaceScopes ) ){
     71    bool IsSameAreaNamespace( const NamespaceScopes &baseNamespaceScopes, const NamespaceScopes &entryNamespaceScopes ) const
     72    {
     73        if( entryNamespaceScopes.size() )
     74        {
     75            if( IsCoverd( baseNamespaceScopes, entryNamespaceScopes ) )
     76            {
    7477                // 包括しているときは同一と見なす
    7578                return true;
     
    7780        }
    7881        else{
    79             if( baseNamespaceScopes.size() ){
     82            if( baseNamespaceScopes.size() )
     83            {
    8084                // 名前空間の判断が必要なとき
    8185                if( this->importedNamespaces.IsImported( baseNamespaceScopes )
    82                     || IsLiving( baseNamespaceScopes ) ){
     86                    || IsLiving( baseNamespaceScopes ) )
     87                {
    8388                    // Using指定があるとき
    8489                    // または
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/Symbol.h

    r402 r504  
    1111class Symbol
    1212{
     13    static const NamespaceSupporter *namespaceSupporter;
     14
    1315    NamespaceScopes namespaceScopes;
    1416    string name;
     
    5961    }
    6062
     63    static void RegistNamespaceSupporter( const NamespaceSupporter *namespaceSupporter )
     64    {
     65        Symbol::namespaceSupporter = namespaceSupporter;
     66    }
     67
    6168    virtual const NamespaceScopes &GetNamespaceScopes() const
    6269    {
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Symbol.cpp

    r461 r504  
    33#include <Compiler.h>
    44#include <Symbol.h>
     5
     6const NamespaceSupporter *Symbol::namespaceSupporter = NULL;
    57
    68Symbol::Symbol( const char *fullName )
     
    4143    }
    4244
    43     return compiler.GetNamespaceSupporter().IsSameAreaNamespace( GetNamespaceScopes(), namespaceScopes );
     45    _ASSERTE( namespaceSupporter );
     46    return namespaceSupporter->IsSameAreaNamespace( GetNamespaceScopes(), namespaceScopes );
    4447}
    4548bool Symbol::IsEqualSymbol( const Symbol &symbol ) const
Note: See TracChangeset for help on using the changeset viewer.