Changeset 75 in dev for BasicCompiler_Common/Class.h
- Timestamp:
- Mar 20, 2007, 4:36:16 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/Class.h
r73 r75 1 1 #include <vector> 2 #include "Type.h" 2 3 3 4 class 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 }; 5 class UserProc; 14 6 15 7 #define ACCESS_NON 0 … … 18 10 #define ACCESS_PROTECTED 3 19 11 20 class CMember{ 12 class CMember : public Type 13 { 21 14 bool isConst; 22 bool isRef;23 15 public: 24 16 char *name; 25 17 int SubScripts[MAX_ARRAYDIM]; 26 TYPEINFO TypeInfo;27 18 28 19 DWORD dwAccess; … … 34 25 35 26 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 ); 38 29 CMember(); 39 30 ~CMember(); 40 31 41 32 bool IsConst(); 42 bool IsRef();43 int GetSize();44 33 45 34 … … 48 37 class CMethod{ 49 38 public: 50 SubInfo *psi;39 UserProc *pUserProc; 51 40 DWORD dwAccess; 52 41 BOOL bAbstract; … … 115 104 //メンバ、メソッドの追加 116 105 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); 120 109 121 110 //重複チェック … … 124 113 125 114 //メソッド取得 126 CMethod *GetMethodInfo( SubInfo *psi );127 CMethod *GetStaticMethodInfo( SubInfo *psi );115 CMethod *GetMethodInfo( UserProc *pUserProc ) const; 116 CMethod *GetStaticMethodInfo( UserProc *pUserProc ) const; 128 117 129 118 //メソッドの存在を確認 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; 132 121 133 122 //メソッドを列挙 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; 137 126 138 127 //デフォルト コンストラクタ メソッドを取得 … … 157 146 long vtbl_offset; 158 147 public: 159 int GetFuncNumInVtbl( const SubInfo *psi) const;148 int GetFuncNumInVtbl( const UserProc *pUserProc ) const; 160 149 LONG_PTR GetVtblGlobalOffset(void); 161 150 void ActionVtblSchedule(LONG_PTR ImageBase, LONG_PTR MemPos_CodeSection); 162 bool IsAbstract() ;151 bool IsAbstract() const; 163 152 164 153 … … 169 158 void NotifyStartConstructorCompile(); 170 159 void NotifyFinishConstructorCompile(); 171 bool IsCompilingConstructor() ;160 bool IsCompilingConstructor() const; 172 161 173 162 //デストラクタをコンパイルしているかどうかのチェックフラグ … … 177 166 void NotifyStartDestructorCompile(); 178 167 void NotifyFinishDestructorCompile(); 179 bool IsCompilingDestructor() ;168 bool IsCompilingDestructor() const; 180 169 181 170 182 171 //自身と等しいクラスかどうかを確認 183 bool IsEquals( CClass *pClass );172 bool IsEquals( const CClass *pClass ) const; 184 173 185 174 //自身の派生クラスかどうかを確認 186 bool IsSubClass( CClass *pClass );175 bool IsSubClass( const CClass *pClass ) const; 187 176 188 177 //自身と等しいまたは派生クラスかどうかを確認 189 bool IsEqualsOrSubClass( CClass *pClass );178 bool IsEqualsOrSubClass( const CClass *pClass ) const; 190 179 191 180 … … 214 203 CClass *check(const char *name); 215 204 216 CClass *AddClass(const char *name,int NowLine);205 CClass *AddClass(const char *name,int nowLine); 217 206 218 207 void ActionVtblSchedule(LONG_PTR ImageBase, LONG_PTR MemPos_CodeSection); … … 220 209 private: 221 210 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); 224 213 public: 225 214 void InitNames(void); … … 245 234 public: 246 235 //コンパイル開始の通知を受け取るメソッド 247 void StartCompile( SubInfo *psi);236 void StartCompile( UserProc *pUserProc ); 248 237 249 238 //現在コンパイル中のメソッド情報を取得
Note:
See TracChangeset
for help on using the changeset viewer.