[184] | 1 | #pragma once
|
---|
| 2 |
|
---|
[206] | 3 | #include <option.h>
|
---|
| 4 | #include <Program.h>
|
---|
| 5 | #include <Prototype.h>
|
---|
| 6 | #include <Method.h>
|
---|
| 7 | #include <Member.h>
|
---|
[266] | 8 | #include <Source.h>
|
---|
[184] | 9 |
|
---|
[206] | 10 | class UserProc;
|
---|
[290] | 11 | class CClass;
|
---|
[325] | 12 | class Delegate;
|
---|
[206] | 13 |
|
---|
[342] | 14 | class ClassPrototype : public Prototype
|
---|
[184] | 15 | {
|
---|
[342] | 16 | // 動的メソッド
|
---|
| 17 | Methods dynamicMethods;
|
---|
| 18 |
|
---|
| 19 | // XMLシリアライズ用
|
---|
| 20 | private:
|
---|
| 21 | friend class boost::serialization::access;
|
---|
| 22 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
| 23 | {
|
---|
| 24 | ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Prototype );
|
---|
| 25 | ar & BOOST_SERIALIZATION_NVP( dynamicMethods );
|
---|
| 26 | }
|
---|
| 27 |
|
---|
[184] | 28 | public:
|
---|
[342] | 29 | ClassPrototype( const NamespaceScopes &namespaceScopes, const string &name )
|
---|
| 30 | : Prototype( namespaceScopes, name )
|
---|
| 31 | {
|
---|
| 32 | }
|
---|
| 33 | ClassPrototype()
|
---|
| 34 | : Prototype()
|
---|
| 35 | {
|
---|
| 36 | }
|
---|
| 37 | const Methods &GetDynamicMethods() const
|
---|
| 38 | {
|
---|
| 39 | return dynamicMethods;
|
---|
| 40 | }
|
---|
| 41 | Methods &GetDynamicMethods()
|
---|
| 42 | {
|
---|
| 43 | return dynamicMethods;
|
---|
| 44 | }
|
---|
| 45 | };
|
---|
| 46 |
|
---|
| 47 | class Interface : public ClassPrototype
|
---|
| 48 | {
|
---|
| 49 | const CClass *pInterfaceClass;
|
---|
| 50 | mutable int vtblOffset;
|
---|
| 51 | public:
|
---|
| 52 | Interface( const CClass *pInterfaceClass )
|
---|
[206] | 53 | : pInterfaceClass( pInterfaceClass )
|
---|
[342] | 54 | , vtblOffset( -1 )
|
---|
[184] | 55 | {
|
---|
| 56 | }
|
---|
[206] | 57 |
|
---|
[342] | 58 | const CClass &GetClass() const{
|
---|
[206] | 59 | return *pInterfaceClass;
|
---|
| 60 | }
|
---|
[342] | 61 | LONG_PTR GetVtblOffset() const
|
---|
[191] | 62 | {
|
---|
[206] | 63 | return vtblOffset;
|
---|
[191] | 64 | }
|
---|
[342] | 65 | void SetVtblOffset( LONG_PTR vtblOffset ) const
|
---|
| 66 | {
|
---|
| 67 | this->vtblOffset = vtblOffset;
|
---|
| 68 | }
|
---|
[206] | 69 | };
|
---|
[342] | 70 | typedef std::vector<Interface> Interfaces;
|
---|
[184] | 71 |
|
---|
[342] | 72 | class CClass: public ClassPrototype, public Jenga::Common::ObjectInHashmap<CClass>
|
---|
[206] | 73 | {
|
---|
| 74 | public:
|
---|
| 75 | // 型の種類
|
---|
| 76 | enum ClassType{
|
---|
| 77 | Class,
|
---|
| 78 | Interface,
|
---|
| 79 | Enum,
|
---|
| 80 | Delegate,
|
---|
| 81 | Structure,
|
---|
| 82 | };
|
---|
[193] | 83 |
|
---|
[206] | 84 | private:
|
---|
| 85 | ClassType classType;
|
---|
[184] | 86 |
|
---|
[206] | 87 | // importされている名前空間
|
---|
| 88 | NamespaceScopesCollection importedNamespaces;
|
---|
[290] | 89 |
|
---|
| 90 | // 型パラメータ
|
---|
| 91 | GenericTypes formalGenericTypes;
|
---|
| 92 |
|
---|
[206] | 93 | // 継承クラス
|
---|
| 94 | const CClass *pSuperClass;
|
---|
[184] | 95 |
|
---|
[299] | 96 | // 継承クラスの型パラメータ(実パラメータ)
|
---|
| 97 | Types superClassActualTypeParameters;
|
---|
| 98 |
|
---|
[206] | 99 | // Blittable型情報
|
---|
| 100 | Type blittableType;
|
---|
[184] | 101 |
|
---|
[206] | 102 | // 実装するインターフェイス
|
---|
| 103 | Interfaces interfaces;
|
---|
[191] | 104 |
|
---|
[206] | 105 | // 動的メンバ
|
---|
| 106 | Members dynamicMembers;
|
---|
[191] | 107 |
|
---|
[206] | 108 | // 静的メンバ
|
---|
| 109 | Members staticMembers;
|
---|
| 110 |
|
---|
| 111 | // 動的メソッド
|
---|
| 112 | int ConstructorMemberSubIndex;
|
---|
| 113 | int DestructorMemberSubIndex;
|
---|
| 114 | int vtblNum; // 仮想関数の数
|
---|
| 115 |
|
---|
| 116 | // 静的メソッド
|
---|
| 117 | Methods staticMethods;
|
---|
| 118 |
|
---|
[232] | 119 | //アラインメント値
|
---|
| 120 | int fixedAlignment;
|
---|
| 121 |
|
---|
[191] | 122 | // XMLシリアライズ用
|
---|
[208] | 123 | // TODO: xml未完成
|
---|
[191] | 124 | private:
|
---|
| 125 | friend class boost::serialization::access;
|
---|
| 126 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
| 127 | {
|
---|
[206] | 128 | trace_for_serialize( "serializing - CClass" );
|
---|
| 129 |
|
---|
[342] | 130 | ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( ClassPrototype );
|
---|
[206] | 131 | ar & BOOST_SERIALIZATION_NVP( classType );
|
---|
| 132 | ar & BOOST_SERIALIZATION_NVP( importedNamespaces );
|
---|
[293] | 133 | ar & BOOST_SERIALIZATION_NVP( formalGenericTypes );
|
---|
[206] | 134 | ar & boost::serialization::make_nvp( "pSuperClass", const_cast<CClass *&>(pSuperClass) );
|
---|
[299] | 135 | ar & BOOST_SERIALIZATION_NVP( superClassActualTypeParameters );
|
---|
[206] | 136 | ar & BOOST_SERIALIZATION_NVP( blittableType );
|
---|
| 137 | //ar & BOOST_SERIALIZATION_NVP( interfaces );
|
---|
| 138 | ar & BOOST_SERIALIZATION_NVP( dynamicMembers );
|
---|
| 139 | ar & BOOST_SERIALIZATION_NVP( staticMembers );
|
---|
| 140 | ar & BOOST_SERIALIZATION_NVP( ConstructorMemberSubIndex );
|
---|
| 141 | ar & BOOST_SERIALIZATION_NVP( DestructorMemberSubIndex );
|
---|
| 142 | ar & BOOST_SERIALIZATION_NVP( vtblNum );
|
---|
| 143 | ar & BOOST_SERIALIZATION_NVP( staticMethods );
|
---|
[232] | 144 | ar & BOOST_SERIALIZATION_NVP( fixedAlignment );
|
---|
[191] | 145 | }
|
---|
[184] | 146 |
|
---|
[206] | 147 | bool isReady;
|
---|
[184] | 148 | public:
|
---|
[206] | 149 |
|
---|
| 150 | CClass( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const string &name )
|
---|
[342] | 151 | : ClassPrototype( namespaceScopes, name )
|
---|
[206] | 152 | , importedNamespaces( importedNamespaces )
|
---|
| 153 | , classType( Class )
|
---|
| 154 | , pSuperClass( NULL )
|
---|
[290] | 155 | , blittableType( Type() )
|
---|
[206] | 156 | , isReady( false )
|
---|
[232] | 157 | , fixedAlignment( 0 )
|
---|
[206] | 158 | , ConstructorMemberSubIndex( -1 )
|
---|
| 159 | , DestructorMemberSubIndex( -1 )
|
---|
| 160 | , vtblNum( 0 )
|
---|
| 161 | , vtbl_offset( -1 )
|
---|
| 162 | , isCompilingConstructor( false )
|
---|
| 163 | , isCompilingDestructor( false )
|
---|
| 164 | , pobj_NextClass( NULL )
|
---|
[191] | 165 | {
|
---|
| 166 | }
|
---|
[206] | 167 | CClass()
|
---|
[342] | 168 | : ClassPrototype()
|
---|
[206] | 169 | , importedNamespaces()
|
---|
| 170 | , classType()
|
---|
| 171 | , pSuperClass( NULL )
|
---|
[290] | 172 | , blittableType( Type() )
|
---|
[206] | 173 | , isReady( false )
|
---|
[232] | 174 | , fixedAlignment( 0 )
|
---|
[206] | 175 | , ConstructorMemberSubIndex( -1 )
|
---|
| 176 | , DestructorMemberSubIndex( -1 )
|
---|
| 177 | , vtblNum( 0 )
|
---|
| 178 | , vtbl_offset( -1 )
|
---|
| 179 | , isCompilingConstructor( false )
|
---|
| 180 | , isCompilingDestructor( false )
|
---|
| 181 | , pobj_NextClass( NULL )
|
---|
| 182 | {
|
---|
| 183 | }
|
---|
| 184 | ~CClass()
|
---|
| 185 | {
|
---|
| 186 | // 動的メンバ
|
---|
| 187 | BOOST_FOREACH( CMember *member, dynamicMembers ){
|
---|
| 188 | delete member;
|
---|
| 189 | }
|
---|
[191] | 190 |
|
---|
[206] | 191 | // 静的メンバ
|
---|
| 192 | BOOST_FOREACH( CMember *member, staticMembers ){
|
---|
| 193 | delete member;
|
---|
| 194 | }
|
---|
| 195 | }
|
---|
[184] | 196 |
|
---|
[270] | 197 | virtual const std::string &GetKeyName() const
|
---|
| 198 | {
|
---|
| 199 | return GetName();
|
---|
| 200 | }
|
---|
| 201 | virtual bool IsDuplication( const CClass *pClass ) const
|
---|
| 202 | {
|
---|
| 203 | if( pClass->IsEqualSymbol( *this ) )
|
---|
| 204 | {
|
---|
| 205 | return true;
|
---|
| 206 | }
|
---|
| 207 | return false;
|
---|
| 208 | }
|
---|
| 209 |
|
---|
[206] | 210 | void Readed(){
|
---|
| 211 | isReady = true;
|
---|
| 212 | }
|
---|
| 213 | bool IsReady() const{
|
---|
| 214 | return isReady;
|
---|
| 215 | }
|
---|
[184] | 216 |
|
---|
[206] | 217 | const NamespaceScopesCollection &GetImportedNamespaces() const
|
---|
| 218 | {
|
---|
| 219 | return importedNamespaces;
|
---|
| 220 | }
|
---|
| 221 |
|
---|
[290] | 222 | // 型パラメータ
|
---|
| 223 | void AddFormalGenericType( GenericType genericType )
|
---|
| 224 | {
|
---|
| 225 | this->formalGenericTypes.push_back( genericType );
|
---|
| 226 | }
|
---|
[299] | 227 | int GetFormalGenericTypeParameterIndex( const std::string &name ) const
|
---|
| 228 | {
|
---|
| 229 | int i = 0;
|
---|
| 230 | BOOST_FOREACH( const GenericType &genericType, formalGenericTypes )
|
---|
| 231 | {
|
---|
| 232 | if( genericType.GetName() == name )
|
---|
| 233 | {
|
---|
| 234 | return i;
|
---|
| 235 | }
|
---|
| 236 | i++;
|
---|
| 237 | }
|
---|
| 238 | return -1;
|
---|
| 239 | }
|
---|
[290] | 240 | bool IsExistFormalGenericTypeParameter( const std::string &name ) const
|
---|
| 241 | {
|
---|
| 242 | BOOST_FOREACH( const GenericType &genericType, formalGenericTypes )
|
---|
| 243 | {
|
---|
| 244 | if( genericType.GetName() == name )
|
---|
| 245 | {
|
---|
| 246 | return true;
|
---|
| 247 | }
|
---|
| 248 | }
|
---|
| 249 | return false;
|
---|
| 250 | }
|
---|
| 251 |
|
---|
[206] | 252 | // 継承元クラス
|
---|
| 253 | bool HasSuperClass() const
|
---|
| 254 | {
|
---|
| 255 | return ( pSuperClass != NULL );
|
---|
| 256 | }
|
---|
| 257 | const CClass &GetSuperClass() const
|
---|
| 258 | {
|
---|
| 259 | return *pSuperClass;
|
---|
| 260 | }
|
---|
| 261 | void SetSuperClass( const CClass *pSuperClass )
|
---|
| 262 | {
|
---|
| 263 | this->pSuperClass = pSuperClass;
|
---|
| 264 | }
|
---|
[299] | 265 | const Types &GetSuperClassActualTypeParameters() const
|
---|
| 266 | {
|
---|
| 267 | return superClassActualTypeParameters;
|
---|
| 268 | }
|
---|
| 269 | void SetSuperClassActualTypeParameters( const Types &actualTypeParameters )
|
---|
| 270 | {
|
---|
| 271 | this->superClassActualTypeParameters = actualTypeParameters;
|
---|
| 272 | }
|
---|
[206] | 273 |
|
---|
| 274 | // Blittable型
|
---|
| 275 | bool IsBlittableType() const
|
---|
| 276 | {
|
---|
| 277 | return !blittableType.IsNull();
|
---|
| 278 | }
|
---|
| 279 | const Type &GetBlittableType() const
|
---|
| 280 | {
|
---|
| 281 | return blittableType;
|
---|
| 282 | }
|
---|
| 283 | void SetBlittableType( const Type &type ){
|
---|
| 284 | blittableType = type;
|
---|
| 285 | }
|
---|
| 286 |
|
---|
| 287 | bool IsClass() const;
|
---|
| 288 | bool IsInterface() const;
|
---|
| 289 | bool IsEnum() const;
|
---|
| 290 | bool IsDelegate() const;
|
---|
| 291 | bool IsStructure() const;
|
---|
| 292 | void SetClassType( ClassType classType )
|
---|
| 293 | {
|
---|
| 294 | this->classType = classType;
|
---|
| 295 | }
|
---|
| 296 |
|
---|
| 297 |
|
---|
| 298 | //コンストラクタをコンパイルしているかどうかのチェックフラグ
|
---|
[184] | 299 | private:
|
---|
[206] | 300 | mutable bool isCompilingConstructor;
|
---|
[184] | 301 | public:
|
---|
[206] | 302 | void NotifyStartConstructorCompile() const;
|
---|
| 303 | void NotifyFinishConstructorCompile() const;
|
---|
| 304 | bool IsCompilingConstructor() const;
|
---|
[184] | 305 |
|
---|
[206] | 306 | //デストラクタをコンパイルしているかどうかのチェックフラグ
|
---|
| 307 | private:
|
---|
| 308 | mutable bool isCompilingDestructor;
|
---|
| 309 | public:
|
---|
| 310 | void NotifyStartDestructorCompile() const;
|
---|
| 311 | void NotifyFinishDestructorCompile() const;
|
---|
| 312 | bool IsCompilingDestructor() const;
|
---|
[191] | 313 |
|
---|
[193] | 314 |
|
---|
[206] | 315 | //自身の派生クラスかどうかを確認
|
---|
| 316 | bool IsSubClass( const CClass *pClass ) const;
|
---|
| 317 |
|
---|
| 318 | //自身と等しいまたは派生クラスかどうかを確認
|
---|
| 319 | bool IsEqualsOrSubClass( const CClass *pClass ) const;
|
---|
| 320 |
|
---|
| 321 | // 自身と等しいまたは派生クラス、基底クラスかどうかを確認
|
---|
| 322 | bool IsEqualsOrSubClassOrSuperClass( const CClass &objClass ) const;
|
---|
| 323 |
|
---|
| 324 | // インターフェイス
|
---|
| 325 | bool HasInterfaces() const
|
---|
| 326 | {
|
---|
| 327 | return ( interfaces.size() != 0 );
|
---|
| 328 | }
|
---|
[342] | 329 | const Interfaces &GetInterfaces() const
|
---|
| 330 | {
|
---|
| 331 | return interfaces;
|
---|
| 332 | }
|
---|
[206] | 333 | bool IsInheritsInterface( const CClass *pInterfaceClass ) const;
|
---|
| 334 |
|
---|
[340] | 335 | // クラス継承
|
---|
[206] | 336 | bool Inherits( const char *inheritNames, int nowLine );
|
---|
[299] | 337 | bool InheritsClass( const CClass &inheritsClass, const Types &actualTypeParameters, int nowLine );
|
---|
[206] | 338 | bool InheritsInterface( const CClass &inheritsClass, int nowLine );
|
---|
| 339 |
|
---|
[340] | 340 | // インターフェイス実装
|
---|
[342] | 341 | bool Implements( const CClass &interfaceClass, int nowLine );
|
---|
[340] | 342 | bool Implements( const char *interfaceNames, int nowLine );
|
---|
| 343 |
|
---|
[206] | 344 | //メンバ、メソッドの追加
|
---|
| 345 | CMember *CreateMember( Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer, int nowLine );
|
---|
| 346 | void AddMember( Prototype::Accessibility accessibility, bool idConst, bool isRef, char *buffer, int nowLine );
|
---|
| 347 | void AddStaticMember( Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer, int nowLine );
|
---|
| 348 |
|
---|
| 349 | void AddMethod(CClass *pobj_c, Prototype::Accessibility accessibility, BOOL bStatic, bool isConst, bool isAbstract,
|
---|
| 350 | bool isVirtual, bool isOverride, char *buffer, int nowLine);
|
---|
| 351 |
|
---|
| 352 | //重複チェック
|
---|
| 353 | bool DupliCheckAll(const char *name);
|
---|
| 354 | bool DupliCheckMember(const char *name);
|
---|
| 355 |
|
---|
| 356 | const Members &GetDynamicMembers() const
|
---|
| 357 | {
|
---|
| 358 | return dynamicMembers;
|
---|
| 359 | }
|
---|
| 360 | const Members &GetStaticMembers() const
|
---|
| 361 | {
|
---|
| 362 | return staticMembers;
|
---|
| 363 | }
|
---|
| 364 | Members &GetDynamicMembers()
|
---|
| 365 | {
|
---|
| 366 | return dynamicMembers;
|
---|
| 367 | }
|
---|
| 368 | Members &GetStaticMembers()
|
---|
| 369 | {
|
---|
| 370 | return staticMembers;
|
---|
| 371 | }
|
---|
| 372 |
|
---|
| 373 | const Methods &GetStaticMethods() const
|
---|
| 374 | {
|
---|
| 375 | return staticMethods;
|
---|
| 376 | }
|
---|
| 377 | Methods &GetStaticMethods()
|
---|
| 378 | {
|
---|
| 379 | return staticMethods;
|
---|
| 380 | }
|
---|
| 381 |
|
---|
| 382 | //デフォルト コンストラクタ
|
---|
| 383 | const CMethod *GetConstructorMethod() const
|
---|
| 384 | {
|
---|
| 385 | if( ConstructorMemberSubIndex == -1 ) return NULL;
|
---|
[342] | 386 | return GetDynamicMethods()[ConstructorMemberSubIndex];
|
---|
[206] | 387 | }
|
---|
| 388 | void SetConstructorMemberSubIndex( int constructorMemberSubIndex )
|
---|
| 389 | {
|
---|
| 390 | this->ConstructorMemberSubIndex = constructorMemberSubIndex;
|
---|
| 391 | }
|
---|
| 392 |
|
---|
| 393 | //デストラクタ メソッドを取得
|
---|
| 394 | const CMethod *GetDestructorMethod() const
|
---|
| 395 | {
|
---|
| 396 | if( DestructorMemberSubIndex == -1 ) return NULL;
|
---|
[342] | 397 | return GetDynamicMethods()[DestructorMemberSubIndex];
|
---|
[206] | 398 | }
|
---|
| 399 | void SetDestructorMemberSubIndex( int destructorMemberSubIndex )
|
---|
| 400 | {
|
---|
| 401 | this->DestructorMemberSubIndex = destructorMemberSubIndex;
|
---|
| 402 | }
|
---|
| 403 |
|
---|
[325] | 404 | // デリゲート情報を取得
|
---|
| 405 | const ::Delegate &GetDelegate() const;
|
---|
| 406 |
|
---|
[232] | 407 | // ユーザ指定のアラインメント固定値
|
---|
| 408 | int GetFixedAlignment() const
|
---|
| 409 | {
|
---|
| 410 | return fixedAlignment;
|
---|
| 411 | }
|
---|
| 412 | void SetFixedAlignment( int fixedAlignment )
|
---|
| 413 | {
|
---|
| 414 | this->fixedAlignment = fixedAlignment;
|
---|
| 415 | }
|
---|
| 416 |
|
---|
[206] | 417 | // メンバの総合サイズを取得
|
---|
| 418 | int GetSize() const;
|
---|
| 419 |
|
---|
| 420 | // メンバのオフセットを取得
|
---|
| 421 | int GetMemberOffset( const char *memberName, int *pMemberNum = NULL ) const;
|
---|
| 422 | private:
|
---|
| 423 | // アラインメント値を取得
|
---|
| 424 | int GetAlignment() const;
|
---|
| 425 |
|
---|
[342] | 426 |
|
---|
| 427 | /////////////////////////////////////////////////////////////////
|
---|
| 428 | // vtbl
|
---|
| 429 | /////////////////////////////////////////////////////////////////
|
---|
[206] | 430 | public:
|
---|
[342] | 431 | // vtblに存在する仮想関数の数
|
---|
| 432 | int GetVtblNum() const
|
---|
| 433 | {
|
---|
| 434 | return vtblNum;
|
---|
| 435 | }
|
---|
| 436 | void SetVtblNum( int vtblNum )
|
---|
| 437 | {
|
---|
| 438 | this->vtblNum = vtblNum;
|
---|
| 439 | }
|
---|
| 440 | void AddVtblNum( int vtblNum )
|
---|
| 441 | {
|
---|
| 442 | this->vtblNum += vtblNum;
|
---|
| 443 | }
|
---|
| 444 | bool IsExistVirtualFunctions() const
|
---|
| 445 | {
|
---|
| 446 | return ( vtblNum > 0 );
|
---|
| 447 | }
|
---|
| 448 |
|
---|
| 449 | private:
|
---|
| 450 | long vtbl_offset;
|
---|
| 451 | long vtblMasterListOffset;
|
---|
| 452 | std::vector<LONG_PTR> vtblMasterList;
|
---|
| 453 | public:
|
---|
| 454 | int GetVtblMasterListIndex( const UserProc *pUserProc ) const;
|
---|
[206] | 455 | int GetFuncNumInVtbl( const UserProc *pUserProc ) const;
|
---|
[342] | 456 | LONG_PTR GetVtblMasterListOffset() const;
|
---|
| 457 | void GenerateVTablePart( LONG_PTR &vtableDataTableOffset ) const;
|
---|
| 458 | void GenerateVTableMasterList( const std::vector<LONG_PTR> &vtableMasterList, LONG_PTR &offset );
|
---|
| 459 | void GenerateFullVTables();
|
---|
| 460 | void ActionVtblSchedule( LONG_PTR ImageBase, LONG_PTR MemPos_CodeSection, LONG_PTR MemPos_DataSection );
|
---|
[206] | 461 | bool IsAbstract() const;
|
---|
| 462 |
|
---|
| 463 |
|
---|
| 464 | //線形リスト用
|
---|
| 465 | CClass *pobj_NextClass;
|
---|
| 466 | };
|
---|
| 467 |
|
---|
[270] | 468 | class Classes : public Jenga::Common::Hashmap<CClass>
|
---|
[206] | 469 | {
|
---|
[191] | 470 | // XMLシリアライズ用
|
---|
[206] | 471 | public:
|
---|
| 472 | Classes()
|
---|
| 473 | : pCompilingMethod( NULL )
|
---|
| 474 | , pStringClass( NULL )
|
---|
| 475 | , pObjectClass( NULL )
|
---|
| 476 | {
|
---|
| 477 | }
|
---|
| 478 | ~Classes()
|
---|
| 479 | {
|
---|
| 480 | }
|
---|
| 481 |
|
---|
| 482 | virtual CClass *Create( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const char *name);
|
---|
| 483 | bool Insert( CClass *pClass );
|
---|
| 484 | CClass *Add( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const char *name,int nowLine);
|
---|
| 485 | virtual void CollectClassesForNameOnly( const BasicSource &source );
|
---|
| 486 |
|
---|
[342] | 487 | // vtblを一時的に生成
|
---|
[282] | 488 | void GenerateVTables();
|
---|
[206] | 489 |
|
---|
[342] | 490 | // vtblのを正規のオフセットで再構築
|
---|
| 491 | void ActionVtblSchedule(LONG_PTR ImageBase, LONG_PTR MemPos_CodeSection, LONG_PTR MemPos_DataSection );
|
---|
| 492 |
|
---|
[206] | 493 | virtual void InitStaticMember();
|
---|
| 494 |
|
---|
| 495 | private:
|
---|
| 496 | bool MemberVar_LoopRefCheck(const CClass &objClass);
|
---|
| 497 | public:
|
---|
| 498 | virtual void GetClass_recur(const char *lpszInheritsClass);
|
---|
| 499 | virtual void GetAllClassInfo();
|
---|
| 500 | virtual void Compile_System_InitializeUserTypes();
|
---|
| 501 |
|
---|
| 502 | const CClass *Find( const NamespaceScopes &namespaceScopes, const string &name ) const;
|
---|
| 503 | const CClass *Find( const string &fullName ) const;
|
---|
| 504 |
|
---|
| 505 |
|
---|
| 506 | /////////////////////////////
|
---|
| 507 | // 現在コンパイル中の情報
|
---|
| 508 | /////////////////////////////
|
---|
| 509 | private:
|
---|
| 510 | const CMethod *pCompilingMethod;
|
---|
| 511 | public:
|
---|
| 512 | void StartCompile( const UserProc *pUserProc );
|
---|
| 513 |
|
---|
| 514 | //現在コンパイル中のメソッド情報を取得
|
---|
| 515 | const CMethod *GetNowCompilingMethodInfo(){
|
---|
| 516 | return pCompilingMethod;
|
---|
| 517 | }
|
---|
| 518 |
|
---|
| 519 |
|
---|
| 520 | /////////////////////////////
|
---|
| 521 | // 特殊クラス
|
---|
| 522 | /////////////////////////////
|
---|
[272] | 523 | mutable const CClass *pStringClass;
|
---|
| 524 | mutable const CClass *pObjectClass;
|
---|
| 525 | const CClass *GetStringClassPtr() const;
|
---|
| 526 | const CClass *GetObjectClassPtr() const;
|
---|
[184] | 527 | };
|
---|