[4] | 1 |
|
---|
| 2 |
|
---|
| 3 | class CClass;
|
---|
| 4 | struct SUBINFO;
|
---|
| 5 |
|
---|
| 6 | //データ型
|
---|
| 7 | struct TYPEINFO{
|
---|
| 8 | int type;
|
---|
| 9 | union{
|
---|
| 10 | LONG_PTR lpIndex;
|
---|
| 11 | CClass *pobj_Class;
|
---|
| 12 | }u;
|
---|
| 13 | };
|
---|
| 14 |
|
---|
| 15 | #define ACCESS_NON 0
|
---|
| 16 | #define ACCESS_PRIVATE 1
|
---|
| 17 | #define ACCESS_PUBLIC 2
|
---|
| 18 | #define ACCESS_PROTECTED 3
|
---|
| 19 |
|
---|
| 20 | class CMember{
|
---|
[17] | 21 | bool isConst;
|
---|
[4] | 22 | public:
|
---|
| 23 | char *name;
|
---|
| 24 | int SubScripts[MAX_ARRAYDIM];
|
---|
| 25 | TYPEINFO TypeInfo;
|
---|
| 26 |
|
---|
| 27 | DWORD dwAccess;
|
---|
| 28 |
|
---|
| 29 | char *InitBuf;
|
---|
| 30 | char *ConstractParameter;
|
---|
| 31 |
|
---|
| 32 | int source_code_address;
|
---|
| 33 |
|
---|
| 34 |
|
---|
[17] | 35 | CMember( CClass *pobj_c, DWORD access, bool idConst, char *buffer, int NowLine=-1 );
|
---|
| 36 | CMember( CMember *pobj );
|
---|
[4] | 37 | CMember();
|
---|
| 38 | ~CMember();
|
---|
| 39 |
|
---|
[17] | 40 | bool IsConst();
|
---|
[4] | 41 |
|
---|
[17] | 42 |
|
---|
[4] | 43 | static void InitStaticMember(void);
|
---|
| 44 | };
|
---|
| 45 | class CMethod{
|
---|
| 46 | public:
|
---|
| 47 | SUBINFO *psi;
|
---|
| 48 | DWORD dwAccess;
|
---|
| 49 | BOOL bAbstract;
|
---|
| 50 | BOOL bVirtual;
|
---|
| 51 |
|
---|
| 52 | CClass *pobj_InheritsClass;
|
---|
| 53 |
|
---|
| 54 | CMethod(CMethod *pobj);
|
---|
| 55 | CMethod();
|
---|
| 56 | ~CMethod();
|
---|
| 57 | };
|
---|
| 58 | class CClass{
|
---|
| 59 | public:
|
---|
| 60 | //クラス名
|
---|
| 61 | char *name;
|
---|
| 62 |
|
---|
| 63 | //継承クラスへのポインタ
|
---|
| 64 | CClass *pobj_InheritsClass;
|
---|
| 65 |
|
---|
| 66 | //メンバ情報
|
---|
| 67 | CMember **ppobj_Member;
|
---|
| 68 | int iMemberNum;
|
---|
| 69 |
|
---|
| 70 | //メソッド情報
|
---|
| 71 | CMethod **ppobj_Method;
|
---|
| 72 | int iMethodNum;
|
---|
| 73 | int ConstructorMemberSubIndex;
|
---|
| 74 | int DestructorMemberSubIndex;
|
---|
| 75 | int CopyConstructorMemberSubIndex;
|
---|
| 76 |
|
---|
| 77 | //静的メンバ情報
|
---|
| 78 | CMember **ppobj_StaticMember;
|
---|
| 79 | int iStaticMemberNum;
|
---|
| 80 |
|
---|
| 81 | //静的メソッド情報
|
---|
| 82 | CMethod **ppobj_StaticMethod;
|
---|
| 83 | int iStaticMethodNum;
|
---|
| 84 |
|
---|
| 85 | //仮想関数の数
|
---|
| 86 | int vtbl_num;
|
---|
| 87 |
|
---|
| 88 | //アラインメント値
|
---|
| 89 | int iAlign;
|
---|
| 90 |
|
---|
| 91 |
|
---|
| 92 | public:
|
---|
| 93 | CClass(char *name);
|
---|
| 94 | ~CClass();
|
---|
| 95 |
|
---|
[17] | 96 | void AddMember( DWORD dwAccess, bool idConst, char *buffer );
|
---|
| 97 | void AddStaticMember( DWORD dwAccess, bool isConst, char *buffer, int NowLine );
|
---|
[4] | 98 | void AddMethod(SUBINFO *psi,DWORD dwAccess,BOOL bAbstract,BOOL bVirtual);
|
---|
| 99 | void AddStaticMethod(SUBINFO *psi,DWORD dwAccess);
|
---|
| 100 |
|
---|
| 101 | BOOL DupliCheckAll(char *name);
|
---|
| 102 | BOOL DupliCheckMember(char *name);
|
---|
| 103 |
|
---|
| 104 |
|
---|
| 105 | //vtbl
|
---|
| 106 | private:
|
---|
| 107 | long vtbl_offset;
|
---|
| 108 | LONG_PTR AddVtblDataTable(SUBINFO **ppsi,int length);
|
---|
| 109 | public:
|
---|
| 110 | LONG_PTR GetVtblGlobalOffset(void);
|
---|
| 111 | void ActionVtblSchedule(LONG_PTR ImageBase, LONG_PTR MemPos_CodeSection);
|
---|
| 112 | BOOL IsHoldAbstractFunction(void);
|
---|
| 113 |
|
---|
| 114 |
|
---|
| 115 | //オペレータ関数の取得
|
---|
| 116 | SUBINFO **GetOperatorSubInfo(BYTE idCalc,int &num);
|
---|
| 117 |
|
---|
| 118 |
|
---|
[17] | 119 | //コンストラクタをコンパイルしているかどうかのチェックフラグ
|
---|
| 120 | private:
|
---|
| 121 | bool isCompilingConstructor;
|
---|
| 122 | public:
|
---|
| 123 | void NotifyStartConstructorCompile();
|
---|
| 124 | void NotifyFinishConstructorCompile();
|
---|
| 125 | bool IsCompilingConstructor();
|
---|
| 126 |
|
---|
| 127 |
|
---|
[4] | 128 | //線形リスト用
|
---|
| 129 | CClass *pobj_NextClass;
|
---|
| 130 | };
|
---|
| 131 |
|
---|
| 132 | #define MAX_CLASS_HASH 65535
|
---|
| 133 | class CDBClass{
|
---|
| 134 | int hash(char *name);
|
---|
| 135 | void DestroyClass(CClass *pobj_c);
|
---|
| 136 | public:
|
---|
| 137 | CClass *pobj_ClassHash[MAX_CLASS_HASH];
|
---|
| 138 |
|
---|
| 139 | CDBClass();
|
---|
| 140 | ~CDBClass();
|
---|
| 141 |
|
---|
| 142 | CClass *check(char *name);
|
---|
| 143 |
|
---|
| 144 | CClass *AddClass(char *name,int NowLine);
|
---|
| 145 |
|
---|
| 146 | void ActionVtblSchedule(LONG_PTR ImageBase, LONG_PTR MemPos_CodeSection);
|
---|
| 147 |
|
---|
| 148 | private:
|
---|
| 149 | void AddMemberSub(CClass *pobj_c,DWORD dwAccess,BOOL bStatic,BOOL bAbstract,BOOL bVirtual,BOOL bOverride,char *buffer,int NowLine);
|
---|
| 150 | BOOL MemberVar_LoopRefCheck(CClass *pobj_c);
|
---|
| 151 | public:
|
---|
| 152 | void InitNames(void);
|
---|
| 153 | void GetClass_recur(char *lpszInheritsClass);
|
---|
| 154 | void GetObjectClassInfo(void);
|
---|
| 155 |
|
---|
| 156 |
|
---|
| 157 | //イテレータ
|
---|
| 158 | private:
|
---|
| 159 | CClass **ppobj_IteClass;
|
---|
| 160 | int iIteMaxNum;
|
---|
| 161 | int iIteNextNum;
|
---|
| 162 | public:
|
---|
| 163 | void Iterator_Reset(void);
|
---|
| 164 | BOOL Iterator_HasNext(void);
|
---|
| 165 | CClass *Iterator_GetNext(void);
|
---|
| 166 | int Iterator_GetMaxCount(void);
|
---|
| 167 | };
|
---|
| 168 |
|
---|
| 169 |
|
---|
| 170 | extern CDBClass *pobj_DBClass;
|
---|
| 171 | extern CClass *pobj_CompilingClass;
|
---|