Changeset 75 in dev for BasicCompiler_Common/Class.h


Ignore:
Timestamp:
Mar 20, 2007, 4:36:16 AM (17 years ago)
Author:
dai_9181
Message:

TYPEINFO→Typeへのリファクタリングを実施。64bitはほぼ完了。32bitが全般的に未完成。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler_Common/Class.h

    r73 r75  
    11#include <vector>
     2#include "Type.h"
    23
    34class CClass;
    4 class SubInfo;
    5 
    6 //データ型
    7 struct TYPEINFO{
    8     int type;
    9     union{
    10         LONG_PTR lpIndex;
    11         CClass *pobj_Class;
    12     }u;
    13 };
     5class UserProc;
    146
    157#define ACCESS_NON          0
     
    1810#define ACCESS_PROTECTED    3
    1911
    20 class CMember{
     12class CMember : public Type
     13{
    2114    bool isConst;
    22     bool isRef;
    2315public:
    2416    char *name;
    2517    int SubScripts[MAX_ARRAYDIM];
    26     TYPEINFO TypeInfo;
    2718
    2819    DWORD dwAccess;
     
    3425
    3526
    36     CMember( CClass *pobj_c, DWORD access, bool idConst, bool isRef, char *buffer, int NowLine=-1 );
    37     CMember( CMember *pobj );
     27    CMember( CClass *pobj_c, DWORD access, bool idConst, bool isRef, char *buffer, int nowLine=-1 );
     28    CMember( CMember &member );
    3829    CMember();
    3930    ~CMember();
    4031
    4132    bool IsConst();
    42     bool IsRef();
    43     int GetSize();
    4433
    4534
     
    4837class CMethod{
    4938public:
    50     SubInfo *psi;
     39    UserProc *pUserProc;
    5140    DWORD dwAccess;
    5241    BOOL bAbstract;
     
    115104    //メンバ、メソッドの追加
    116105    void AddMember( DWORD dwAccess, bool idConst, bool isRef, char *buffer );
    117     void AddStaticMember( DWORD dwAccess, bool isConst, bool isRef, char *buffer, int NowLine );
    118     void AddMethod( SubInfo *psi,DWORD dwAccess, bool isConst, BOOL bAbstract, BOOL bVirtual );
    119     void AddStaticMethod(SubInfo *psi,DWORD dwAccess);
     106    void AddStaticMember( DWORD dwAccess, bool isConst, bool isRef, char *buffer, int nowLine );
     107    void AddMethod( UserProc *pUserProc,DWORD dwAccess, bool isConst, BOOL bAbstract, BOOL bVirtual );
     108    void AddStaticMethod(UserProc *pUserProc,DWORD dwAccess);
    120109
    121110    //重複チェック
     
    124113
    125114    //メソッド取得
    126     CMethod *GetMethodInfo( SubInfo *psi );
    127     CMethod *GetStaticMethodInfo( SubInfo *psi );
     115    CMethod *GetMethodInfo( UserProc *pUserProc ) const;
     116    CMethod *GetStaticMethodInfo( UserProc *pUserProc ) const;
    128117
    129118    //メソッドの存在を確認
    130     bool IsExistMethod( const char *name );
    131     bool IsExistStaticMethod( const char *name );
     119    bool IsExistMethod( const char *name ) const;
     120    bool IsExistStaticMethod( const char *name ) const;
    132121
    133122    //メソッドを列挙
    134     void EnumStaticMethod( const char *methodName, std::vector<SubInfo *> &subs ) const;
    135     void EnumMethod( const char *methodName, std::vector<SubInfo *> &subs ) const;
    136     void EnumMethod( const BYTE idOperatorCalc, std::vector<SubInfo *> &subs ) const;
     123    void EnumStaticMethod( const char *methodName, std::vector<UserProc *> &subs ) const;
     124    void EnumMethod( const char *methodName, std::vector<UserProc *> &subs ) const;
     125    void EnumMethod( const BYTE idOperatorCalc, std::vector<UserProc *> &subs ) const;
    137126
    138127    //デフォルト コンストラクタ メソッドを取得
     
    157146    long vtbl_offset;
    158147public:
    159     int GetFuncNumInVtbl( const SubInfo *psi ) const;
     148    int GetFuncNumInVtbl( const UserProc *pUserProc ) const;
    160149    LONG_PTR GetVtblGlobalOffset(void);
    161150    void ActionVtblSchedule(LONG_PTR ImageBase, LONG_PTR MemPos_CodeSection);
    162     bool IsAbstract();
     151    bool IsAbstract() const;
    163152
    164153
     
    169158    void NotifyStartConstructorCompile();
    170159    void NotifyFinishConstructorCompile();
    171     bool IsCompilingConstructor();
     160    bool IsCompilingConstructor() const;
    172161
    173162    //デストラクタをコンパイルしているかどうかのチェックフラグ
     
    177166    void NotifyStartDestructorCompile();
    178167    void NotifyFinishDestructorCompile();
    179     bool IsCompilingDestructor();
     168    bool IsCompilingDestructor() const;
    180169
    181170
    182171    //自身と等しいクラスかどうかを確認
    183     bool IsEquals( CClass *pClass );
     172    bool IsEquals( const CClass *pClass ) const;
    184173
    185174    //自身の派生クラスかどうかを確認
    186     bool IsSubClass( CClass *pClass );
     175    bool IsSubClass( const CClass *pClass ) const;
    187176
    188177    //自身と等しいまたは派生クラスかどうかを確認
    189     bool IsEqualsOrSubClass( CClass *pClass );
     178    bool IsEqualsOrSubClass( const CClass *pClass ) const;
    190179
    191180
     
    214203    CClass *check(const char *name);
    215204
    216     CClass *AddClass(const char *name,int NowLine);
     205    CClass *AddClass(const char *name,int nowLine);
    217206
    218207    void ActionVtblSchedule(LONG_PTR ImageBase, LONG_PTR MemPos_CodeSection);
     
    220209private:
    221210    void AddMethod(CClass *pobj_c, DWORD dwAccess, BOOL bStatic, bool isConst, BOOL bAbstract,
    222         BOOL bVirtual, BOOL bOverride, char *buffer, int NowLine);
    223     BOOL MemberVar_LoopRefCheck(CClass *pobj_c);
     211        BOOL bVirtual, BOOL bOverride, char *buffer, int nowLine);
     212    BOOL MemberVar_LoopRefCheck(const CClass &objClass);
    224213public:
    225214    void InitNames(void);
     
    245234public:
    246235    //コンパイル開始の通知を受け取るメソッド
    247     void StartCompile( SubInfo *psi );
     236    void StartCompile( UserProc *pUserProc );
    248237
    249238    //現在コンパイル中のメソッド情報を取得
Note: See TracChangeset for help on using the changeset viewer.