Changeset 100 in dev for BasicCompiler_Common/Procedure.h


Ignore:
Timestamp:
Apr 24, 2007, 3:17:29 AM (17 years ago)
Author:
dai_9181
Message:

名前空間機能をグローバル関数に適用。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler_Common/Procedure.h

    r97 r100  
    11#pragma once
     2
     3#include <Namespace.h>
     4#include "Parameter.h"
     5#include "Variable.h"
     6
     7class CClass;
     8class CMethod;
    29
    310class Procedure{
     
    1017
    1118private:
    12     const string name;
     19    const string name;                      // プロシージャ名
    1320
    1421    Kind kind;
     
    109116
    110117public:
    111     // ハッシュリスト用
    112     UserProc *pNextData;
    113118
    114119    UserProc( const string &name, Kind kind, bool isMacro, bool isCdecl, bool isExport ):
     
    121126      isAutoGeneration( false ),
    122127      isCompiled( false ),
    123       pNextData( NULL ),
    124128      beginOpAddress( 0 ),
    125129      endOpAddress( 0 )
     
    132136    }
    133137
    134     string GetFullName() const
    135     {
    136         if( HasParentClass() ){
    137             return (string)GetParentClass().name + "." + GetName();
    138         }
    139 
    140         return GetName();
    141     }
     138    string GetFullName() const;
    142139
    143140    bool IsMacro() const
     
    214211        return ( GetName()[0] == '~' );
    215212    }
    216     bool IsVirtual() const
    217     {
    218         if( pMethod == NULL ){
    219             return false;
    220         }
    221         return ( pMethod->bVirtual != 0 );
    222     }
    223 
     213    bool IsVirtual() const;
    224214
    225215    // バイナリコードの位置
     
    259249        return *pCompilingUserProc;
    260250    }
     251
     252    virtual bool EqualName( const string &name ) const;
     253};
     254
     255class GlobalProc : public UserProc
     256{
     257    const NamespaceScopes namespaceScopes;
     258public:
     259    // ハッシュリスト用
     260    GlobalProc *pNextData;
     261
     262    GlobalProc( const NamespaceScopes &namespaceScopes, const string &name, Kind kind, bool isMacro, bool isCdecl, bool isExport ):
     263      UserProc( name, kind, isMacro, isCdecl, isExport ),
     264      namespaceScopes( namespaceScopes ),
     265      pNextData( NULL )
     266    {}
     267    ~GlobalProc(){}
     268
     269    GlobalProc *Create( const NamespaceScopes &namespaceScopes, char *buffer,int nowLine );
     270    bool AddGlobalProc( const NamespaceScopes &namespaceScopes, char *buffer,int nowLine );
     271
     272    const NamespaceScopes &GetNamespaceScopes() const
     273    {
     274        return namespaceScopes;
     275    }
     276
     277    virtual bool EqualName( const string &name ) const;
    261278};
    262279
    263280class DllProc : public Procedure
    264281{
     282    const NamespaceScopes namespaceScopes;
     283
    265284    const string dllFileName;
    266285    const string alias;
     
    271290    DllProc *pNextData;
    272291
    273     DllProc( const string &name, Kind kind, bool isCdecl, const string &dllFileName, const string &alias ):
     292    DllProc( const NamespaceScopes &namespaceScopes, const string &name, Kind kind, bool isCdecl, const string &dllFileName, const string &alias ):
    274293      Procedure( name, kind, isCdecl ),
     294      namespaceScopes( namespaceScopes ),
    275295      dllFileName( dllFileName ),
    276296      alias( alias ),
Note: See TracChangeset for help on using the changeset viewer.