Changeset 513 in dev for trunk/ab5.0/abdev
- Timestamp:
- Apr 30, 2008, 8:38:09 PM (17 years ago)
- Location:
- trunk/ab5.0/abdev
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/BasicCompiler_Common/include/Class.h
r511 r513 3 3 #include <option.h> 4 4 #include <Program.h> 5 #include <Type.h>6 #include <Method.h>7 5 #include <Member.h> 8 6 #include <Source.h> 9 7 10 8 class UserProc; 11 class CClass;12 9 class Delegate; 13 14 class DynamicMethodsPrototype15 {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_NVP( dynamicMethods );25 }26 27 public:28 DynamicMethodsPrototype(){}29 DynamicMethodsPrototype( const DynamicMethodsPrototype &dynamicMethodsPrototype )30 : dynamicMethods( dynamicMethodsPrototype.dynamicMethods )31 {32 }33 ~DynamicMethodsPrototype(){}34 35 const Methods &GetDynamicMethods() const36 {37 return dynamicMethods;38 }39 Methods &GetDynamicMethods()40 {41 return dynamicMethods;42 }43 44 void AddDynamicMethods( CMethod *pMethod )45 {46 dynamicMethods.push_back( pMethod );47 }48 };49 10 50 11 class ClassPrototype : public Prototype, public DynamicMethodsPrototype … … 71 32 } 72 33 }; 73 74 class Interface : public DynamicMethodsPrototype75 {76 const CClass *pInterfaceClass;77 mutable LONG_PTR vtblOffset;78 79 // 型パラメータ(実パラメータ)80 Types actualTypeParameters;81 82 // XMLシリアライズ用83 private:84 friend class boost::serialization::access;85 template<class Archive> void serialize(Archive& ar, const unsigned int version)86 {87 trace_for_serialize( "serializing - Interface" );88 89 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( DynamicMethodsPrototype );90 ar & boost::serialization::make_nvp("pInterfaceClass", const_cast<CClass *&>(pInterfaceClass) );91 ar & BOOST_SERIALIZATION_NVP( vtblOffset );92 ar & BOOST_SERIALIZATION_NVP( actualTypeParameters );93 }94 95 public:96 Interface( const CClass *pInterfaceClass, const Types &actualTypeParameters );97 Interface( const Interface &objInterface )98 : DynamicMethodsPrototype( objInterface )99 , pInterfaceClass( objInterface.pInterfaceClass )100 , vtblOffset( objInterface.vtblOffset )101 {102 }103 Interface()104 {105 }106 107 const CClass &GetClass() const{108 return *pInterfaceClass;109 }110 LONG_PTR GetVtblOffset() const111 {112 return vtblOffset;113 }114 void SetVtblOffset( LONG_PTR vtblOffset ) const115 {116 this->vtblOffset = vtblOffset;117 }118 119 const Types &GetActualTypeParameters() const120 {121 return actualTypeParameters;122 }123 124 std::string GetFullNameWithActualGenericTypeParameters() const;125 };126 typedef std::vector<Interface *> Interfaces;127 34 128 35 class CClass: public ClassPrototype, public Jenga::Common::ObjectInHashmap<CClass> -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Class.cpp
r511 r513 14 14 using namespace ActiveBasic::Compiler; 15 15 16 17 Interface::Interface( const CClass *pInterfaceClass, const Types &actualTypeParameters )18 : DynamicMethodsPrototype()19 , pInterfaceClass( pInterfaceClass )20 , vtblOffset( -1 )21 , actualTypeParameters( actualTypeParameters )22 {23 //メソッドをコピー24 BOOST_FOREACH( const CMethod *pBaseMethod, pInterfaceClass->GetDynamicMethods() )25 {26 CMethod *pMethod = new DynamicMethod( *pBaseMethod );27 28 // アクセシビリティ29 if(pBaseMethod->GetAccessibility() == Prototype::Private){30 pMethod->SetAccessibility( Prototype::None );31 }32 else{33 pMethod->SetAccessibility( pBaseMethod->GetAccessibility() );34 }35 36 //pobj_Inherits37 // ※継承元のClassIndexをセット(入れ子継承を考慮する)38 if(pBaseMethod->GetInheritsClassPtr()==0){39 pMethod->SetInheritsClassPtr( pInterfaceClass );40 }41 else{42 pMethod->SetInheritsClassPtr( pBaseMethod->GetInheritsClassPtr() );43 }44 45 AddDynamicMethods( pMethod );46 }47 }48 49 std::string Interface::GetFullNameWithActualGenericTypeParameters() const50 {51 std::string interfaceName = this->GetClass().GetFullName();52 if( actualTypeParameters.size() )53 {54 std::string actualGenericTypesName;55 BOOST_FOREACH( const Type &typeParameter, actualTypeParameters )56 {57 if( actualGenericTypesName.size() )58 {59 actualGenericTypesName += ",";60 }61 actualGenericTypesName += typeParameter.ToString();62 }63 64 interfaceName += "<" + actualGenericTypesName + ">";65 }66 return interfaceName;67 }68 16 69 17 bool CClass::IsClass() const -
trunk/ab5.0/abdev/BasicCompiler_Common/src/ObjectModule.cpp
r511 r513 52 52 #include <Hashmap.h> 53 53 #include <Configuration.h> 54 #include <Type.h> 55 #include <Method.h> 56 #include <Interface.h> 54 57 #include <Class.h> 55 58 #include <Procedure.h> -
trunk/ab5.0/abdev/compiler_x86/compiler_x86.vcproj
r512 r513 1292 1292 </File> 1293 1293 <File 1294 RelativePath="..\BasicCompiler_Common\src\Interface.cpp" 1295 > 1296 </File> 1297 <File 1294 1298 RelativePath="..\BasicCompiler_Common\src\LexicalAnalyzer_Class.cpp" 1295 1299 > … … 1497 1501 </File> 1498 1502 <File 1503 RelativePath="..\BasicCompiler_Common\include\Interface.h" 1504 > 1505 </File> 1506 <File 1499 1507 RelativePath="..\BasicCompiler_Common\include\LexicalScope.h" 1500 1508 > -
trunk/ab5.0/abdev/compiler_x86/stdafx.h
r511 r513 44 44 #include <Hashmap.h> 45 45 #include <Configuration.h> 46 #include <Type.h> 47 #include <Method.h> 48 #include <Interface.h> 46 49 #include <Class.h> 47 50 #include <Procedure.h>
Note:
See TracChangeset
for help on using the changeset viewer.