Changeset 640 in dev for trunk/ab5.0
- Timestamp:
- Jun 14, 2008, 12:16:27 PM (16 years ago)
- Location:
- trunk/ab5.0/abdev
- Files:
-
- 1 added
- 35 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/ab_common/ab_common.vcproj
r637 r640 534 534 </File> 535 535 <File 536 RelativePath=".\include\Lexical\Resolver.h" 537 > 538 </File> 539 <File 536 540 RelativePath=".\include\Lexical\Source.h" 537 541 > -
trunk/ab5.0/abdev/ab_common/include/Lexical/Class.h
r639 r640 147 147 return false; 148 148 } 149 bool Equals( const CClass *pClass ) const 150 { 151 // ポインタが等しいかどうかを見てみる 152 if( this == pClass ) 153 { 154 return true; 155 } 156 else if( this->IsNeedResolve() || pClass->IsNeedResolve() ) 157 { 158 // 依存関係解決前の状態であれば、パスが等しいかどうかを見てみる 159 if( this->IsDuplication( pClass ) ) 160 { 161 return true; 162 } 163 } 164 return false; 165 } 149 166 150 167 virtual void Using() const; … … 466 483 void GetReferenceOffsetsInitializeBuffer( std::string &referenceOffsetsBuffer, int &numOfReference, int baseOffset = 0 ) const; 467 484 468 virtual bool Resolve( const ObjectModule &resolver );485 virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ); 469 486 }; 470 487 -
trunk/ab5.0/abdev/ab_common/include/Lexical/Const.h
r639 r640 1 1 #pragma once 2 2 3 // 定数3 //è 4 4 class CConst 5 5 : public RelationalObjectModuleItem … … 9 9 _int64 i64data; 10 10 11 // XML シリアライズ用11 // XMLVACYp 12 12 private: 13 13 friend class boost::serialization::access; … … 66 66 double GetDoubleData(); 67 67 68 virtual bool Resolve( const ObjectModule &resolver );68 virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ); 69 69 }; 70 70 class Consts : public Jenga::Common::Hashmap<CConst> 71 71 { 72 // XML シリアライズ用72 // XMLVACYp 73 73 private: 74 74 friend class boost::serialization::access; … … 96 96 }; 97 97 98 // 定数マクロ98 //è}N 99 99 class ConstMacro 100 100 : public RelationalObjectModuleItem … … 104 104 std::string expression; 105 105 106 // XML シリアライズ用106 // XMLVACYp 107 107 private: 108 108 friend class boost::serialization::access; … … 154 154 } 155 155 156 virtual bool Resolve( const ObjectModule &resolver );156 virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ); 157 157 }; 158 158 class ConstMacros 159 159 : public Jenga::Common::Hashmap<ConstMacro> 160 160 { 161 // XML シリアライズ用161 // XMLVACYp 162 162 private: 163 163 friend class boost::serialization::access; -
trunk/ab5.0/abdev/ab_common/include/Lexical/DataTable.h
r639 r640 150 150 void ResetDataSectionBaseOffset( long dataSectionBaseOffset ); 151 151 152 void Resolve( const ObjectModule &resolver );152 void Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ); 153 153 }; -
trunk/ab5.0/abdev/ab_common/include/Lexical/Delegate.h
r639 r640 33 33 34 34 ar & BOOST_SERIALIZATION_NVP( importedNamespaces ); 35 ar & BOOST_SERIALIZATION_NVP( paramStr ); 36 ar & BOOST_SERIALIZATION_NVP( returnTypeName ); 37 ar & BOOST_SERIALIZATION_NVP( sourceIndex ); 35 38 ar & BOOST_SERIALIZATION_NVP( dynamicParams ); 36 39 } … … 92 95 bool IsSimilar( const Delegate &dgt ) const; 93 96 94 virtual bool Resolve( const ObjectModule &resolver );97 virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ); 95 98 }; 96 99 typedef Jenga::Common::Hashmap<Delegate> Delegates; -
trunk/ab5.0/abdev/ab_common/include/Lexical/Interface.h
r639 r640 90 90 } 91 91 92 bool Equals( const Interface *pInterface ) const; 93 92 94 std::string GetFullNameWithActualGenericTypeParameters() const; 93 95 94 virtual bool Resolve( const ObjectModule &resolver );96 virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ); 95 97 }; 96 98 typedef std::vector<Interface *> Interfaces; -
trunk/ab5.0/abdev/ab_common/include/Lexical/Member.h
r639 r640 77 77 } 78 78 79 virtual bool Resolve( const ObjectModule &resolver );79 virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ); 80 80 }; 81 81 typedef std::vector<Member *> Members; -
trunk/ab5.0/abdev/ab_common/include/Lexical/Meta.h
r639 r640 162 162 const CClass *FindClassSupportedTypeDef( const Symbol &symbol ); 163 163 164 void Resolve( const ObjectModule &resolver );164 void Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ); 165 165 }; -
trunk/ab5.0/abdev/ab_common/include/Lexical/Method.h
r639 r640 49 49 virtual void SetNotUseMark( bool isNotUse ) = 0; 50 50 51 virtual bool Resolve( const ObjectModule &resolver );51 virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ); 52 52 }; 53 53 … … 159 159 } 160 160 161 virtual bool Resolve( const ObjectModule &resolver );161 virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ); 162 162 }; 163 163 BOOST_CLASS_EXPORT( DynamicMethod ); … … 235 235 } 236 236 237 virtual bool Resolve( const ObjectModule &resolver );237 virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ); 238 238 }; 239 239 BOOST_CLASS_EXPORT( StaticMethod ); -
trunk/ab5.0/abdev/ab_common/include/Lexical/NativeCode.h
r639 r640 117 117 const ::CClass &GetClass() const; 118 118 119 virtual bool Resolve( const ObjectModule &resolver );119 virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ); 120 120 }; 121 121 typedef std::vector<Schedule> Schedules; … … 249 249 void ResetRelationalObjectModuleIndex( const std::vector<int> &relationTable ); 250 250 251 void Resolve( const ObjectModule &resolver );251 void Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ); 252 252 }; -
trunk/ab5.0/abdev/ab_common/include/Lexical/ObjectModule.h
r637 r640 65 65 66 66 // 依存関係の解決を行う 67 void Resolve( );67 void Resolve( ResolveErrors &resolveErrors ); 68 68 69 69 // 下記の関連になるようなテーブルを取得する -
trunk/ab5.0/abdev/ab_common/include/Lexical/Procedure.h
r639 r640 111 111 } 112 112 113 virtual bool Resolve( const ObjectModule &resolver );113 virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ); 114 114 }; 115 115 … … 161 161 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Procedure ); 162 162 ar & boost::serialization::make_nvp("pParentClass", const_cast<CClass *&>(pParentClass) ); 163 ar & boost::serialization::make_nvp("pInterface", const_cast<Interface *&>(pInterface) ); 163 164 164 165 if( ActiveBasic::Common::Environment::IsRemoveExternal() ) … … 173 174 ar & BOOST_SERIALIZATION_NVP( _paramStr ); 174 175 ar & BOOST_SERIALIZATION_NVP( importedNamespaces ); 175 ar & boost::serialization::make_nvp("pInterface", const_cast<Interface *&>(pInterface) );176 176 ar & BOOST_SERIALIZATION_NVP( pMethod ); 177 177 ar & BOOST_SERIALIZATION_NVP( isMacro ); … … 209 209 virtual bool IsDuplication( const UserProc *pUserProc ) const 210 210 { 211 if( this->GetParentClassPtr() == pUserProc->GetParentClassPtr() // 親クラスが等しい 212 && this->pInterface == pUserProc->pInterface // インターフェイスが等しい 213 && pUserProc->IsEqualSymbol( *this ) // 名前空間及び名前が等しい 214 && this->Params().Equals( pUserProc->Params() ) // パラメータが等しい 215 && this->returnType.Equals( pUserProc->returnType ) ) // 戻り値が等しい 211 bool isEqualParentClass = 212 this->HasParentClass() && pUserProc->HasParentClass() 213 ? this->GetParentClassPtr()->Equals( pUserProc->GetParentClassPtr() ) 214 : this->GetParentClassPtr() == pUserProc->GetParentClassPtr(); 215 bool isEqualInterface = 216 this->pInterface && pUserProc->pInterface 217 ? this->pInterface->Equals( pUserProc->pInterface ) 218 : this->pInterface == pUserProc->pInterface; 219 220 if( isEqualParentClass // 親クラスが等しい 221 && isEqualInterface // インターフェイスが等しい 222 && pUserProc->IsEqualSymbol( *this ) // 名前空間及び名前が等しい 223 && this->Params().Equals( pUserProc->Params() ) // パラメータが等しい 224 && this->returnType.Equals( pUserProc->returnType ) ) // 戻り値が等しい 216 225 { 217 226 return true; … … 376 385 const CMethod &GetMethod() const; 377 386 378 virtual bool Resolve( const ObjectModule &resolver );387 virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ); 379 388 380 389 static const UserProc *pGlobalProc; … … 484 493 } 485 494 486 virtual bool Resolve( const ObjectModule &resolver );495 virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ); 487 496 }; 488 497 class DllProcs : public Jenga::Common::Hashmap<DllProc> … … 525 534 } 526 535 527 virtual bool Resolve( const ObjectModule &resolver );536 virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ); 528 537 }; 529 538 -
trunk/ab5.0/abdev/ab_common/include/Lexical/RelationalObjectModuleItem.h
r639 r640 68 68 } 69 69 70 virtual bool Resolve( const ObjectModule &resolver ) = 0;70 virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ) = 0; 71 71 }; 72 72 -
trunk/ab5.0/abdev/ab_common/include/Lexical/Template.h
r639 r640 47 47 } 48 48 49 virtual bool Resolve( const ObjectModule &resolver );49 virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ); 50 50 }; 51 51 -
trunk/ab5.0/abdev/ab_common/include/Lexical/Type.h
r639 r640 230 230 std::string ToString() const; 231 231 232 virtual bool Resolve( const ObjectModule &resolver );232 virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ); 233 233 234 234 … … 311 311 { 312 312 Type basicType; 313 CClass *pClass;313 const CClass *pClass; 314 314 315 315 // XMLシリアライズ用 … … 321 321 322 322 ar & BOOST_SERIALIZATION_NVP( basicType ); 323 ar & BOOST_SERIALIZATION_NVP( pClass);324 } 325 326 public: 327 BlittableType( const Type &basicType, CClass *pClass )323 ar & boost::serialization::make_nvp("pClass", const_cast<CClass *&>(pClass) ); 324 } 325 326 public: 327 BlittableType( const Type &basicType, const CClass *pClass ) 328 328 : basicType( basicType ) 329 329 , pClass( pClass ) … … 342 342 } 343 343 const std::string GetCreateStaticMethodFullName() const; 344 345 virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ); 344 346 }; 345 347 class BlittableTypes : public std::vector<BlittableType> -
trunk/ab5.0/abdev/ab_common/include/Lexical/TypeDef.h
r639 r640 51 51 } 52 52 53 virtual bool Resolve( const ObjectModule &resolver );53 virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ); 54 54 }; 55 55 -
trunk/ab5.0/abdev/ab_common/include/Lexical/Variable.h
r639 r640 175 175 } 176 176 177 virtual bool Resolve( const ObjectModule &resolver );177 virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ); 178 178 179 179 -
trunk/ab5.0/abdev/ab_common/include/ab_common.h
r637 r640 8 8 #include "Lexical/NamespaceSupporter.h" 9 9 #include "Lexical/Symbol.h" 10 #include "Lexical/Resolver.h" 10 11 #include "Lexical/RelationalObjectModuleItem.h" 11 12 #include "Lexical/Prototype.h" -
trunk/ab5.0/abdev/ab_common/src/Lexical/Class.cpp
r639 r640 869 869 } 870 870 871 bool CClass::Resolve( const ObjectModule &resolver )871 bool CClass::Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ) 872 872 { 873 873 // 型パラメータ 874 874 BOOST_FOREACH( GenericType &genericType, formalGenericTypes ) 875 875 { 876 genericType.GetType().Resolve( resolver );876 genericType.GetType().Resolve( resolver, resolveErrors ); 877 877 } 878 878 … … 882 882 if( this->pSuperClass->IsNeedResolve() ) 883 883 { 884 this->pSuperClass = resolver.meta.GetClasses().FindEx( *pSuperClass ); 884 const CClass *pTempClass = resolver.meta.GetClasses().FindLike( this->pSuperClass ); 885 if( pTempClass ) 886 { 887 this->pSuperClass = pTempClass; 888 } 889 else 890 { 891 resolveErrors.Add( ResolveError( this->pSuperClass->GetRelationalObjectModuleIndex(), this->pSuperClass->GetFullName() ) ); 892 } 885 893 } 886 894 } … … 889 897 BOOST_FOREACH( Type &superClassActualTypeParameter, superClassActualTypeParameters ) 890 898 { 891 superClassActualTypeParameter.Resolve( resolver );899 superClassActualTypeParameter.Resolve( resolver, resolveErrors ); 892 900 } 893 901 894 902 // Blittable型情報 895 blittableType.Resolve( resolver );903 blittableType.Resolve( resolver, resolveErrors ); 896 904 897 905 // 実装するインターフェイス 898 906 BOOST_FOREACH( ::Interface *pInterface, interfaces ) 899 907 { 900 pInterface->Resolve( resolver );908 pInterface->Resolve( resolver, resolveErrors ); 901 909 } 902 910 … … 904 912 BOOST_FOREACH( Member *pMember, dynamicMembers ) 905 913 { 906 pMember->Resolve( resolver );914 pMember->Resolve( resolver, resolveErrors ); 907 915 } 908 916 … … 910 918 BOOST_FOREACH( Member *pMember, staticMembers ) 911 919 { 912 pMember->Resolve( resolver );920 pMember->Resolve( resolver, resolveErrors ); 913 921 } 914 922 … … 916 924 BOOST_FOREACH( CMethod *pMethod, GetDynamicMethods() ) 917 925 { 918 pMethod->Resolve( resolver );926 pMethod->Resolve( resolver, resolveErrors ); 919 927 } 920 928 … … 922 930 BOOST_FOREACH( CMethod *pMethod, staticMethods ) 923 931 { 924 pMethod->Resolve( resolver );932 pMethod->Resolve( resolver, resolveErrors ); 925 933 } 926 934 … … 928 936 BOOST_FOREACH( ActiveBasic::Common::Lexical::ExpandedTemplateClass *pExpandedTemplateClass, expandedTemplateClasses ) 929 937 { 930 pExpandedTemplateClass->Resolve( resolver );938 pExpandedTemplateClass->Resolve( resolver, resolveErrors ); 931 939 } 932 940 -
trunk/ab5.0/abdev/ab_common/src/Lexical/Const.cpp
r639 r640 7 7 } 8 8 9 bool CConst::Resolve( const ObjectModule &resolver )9 bool CConst::Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ) 10 10 { 11 type.Resolve( resolver );11 type.Resolve( resolver, resolveErrors ); 12 12 return true; 13 13 } … … 78 78 } 79 79 80 bool ConstMacro::Resolve( const ObjectModule &resolver )80 bool ConstMacro::Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ) 81 81 { 82 82 // 依存関係を解決すべきメンバは無い -
trunk/ab5.0/abdev/ab_common/src/Lexical/DataTable.cpp
r639 r640 78 78 } 79 79 80 void DataTable::Resolve( const ObjectModule &resolver )80 void DataTable::Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ) 81 81 { 82 82 BOOST_FOREACH( Schedule &schedule, schedules ) 83 83 { 84 schedule.Resolve( resolver );84 schedule.Resolve( resolver, resolveErrors ); 85 85 } 86 86 } -
trunk/ab5.0/abdev/ab_common/src/Lexical/Delegate.cpp
r639 r640 19 19 } 20 20 21 bool Delegate::Resolve( const ObjectModule &resolver )21 bool Delegate::Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ) 22 22 { 23 Procedure::Resolve( resolver );23 Procedure::Resolve( resolver, resolveErrors ); 24 24 25 25 BOOST_FOREACH( Parameter *pParameter, dynamicParams ) 26 26 { 27 pParameter->Resolve( resolver );27 pParameter->Resolve( resolver, resolveErrors ); 28 28 } 29 29 -
trunk/ab5.0/abdev/ab_common/src/Lexical/Interface.cpp
r639 r640 33 33 } 34 34 35 bool Interface::Equals( const Interface *pInterface ) const 36 { 37 // ポインタが等しいかどうかを見てみる 38 if( this == pInterface ) 39 { 40 return true; 41 } 42 else if( this->pInterfaceClass->IsNeedResolve() || pInterface->pInterfaceClass->IsNeedResolve() ) 43 { 44 // 依存関係解決前の状態であれば、パスが等しいかどうかを見てみる 45 if( this-pInterfaceClass->IsDuplication( pInterface->pInterfaceClass ) ) 46 { 47 return true; 48 } 49 } 50 return false; 51 } 52 35 53 std::string Interface::GetFullNameWithActualGenericTypeParameters() const 36 54 { … … 53 71 } 54 72 55 bool Interface::Resolve( const ObjectModule &resolver )73 bool Interface::Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ) 56 74 { 57 75 // 動的メソッド 58 76 BOOST_FOREACH( CMethod *pMethod, GetDynamicMethods() ) 59 77 { 60 pMethod->Resolve( resolver );78 pMethod->Resolve( resolver, resolveErrors ); 61 79 } 62 80 … … 66 84 if( this->pInterfaceClass->IsNeedResolve() ) 67 85 { 68 this->pInterfaceClass = resolver.meta.GetClasses().FindLike( pInterfaceClass ); 86 const CClass *pTempClass = resolver.meta.GetClasses().FindLike( this->pInterfaceClass ); 87 if( pTempClass ) 88 { 89 this->pInterfaceClass = pTempClass; 90 } 91 else 92 { 93 resolveErrors.Add( ResolveError( this->pInterfaceClass->GetRelationalObjectModuleIndex(), this->pInterfaceClass->GetFullName() ) ); 94 } 69 95 } 70 96 } … … 72 98 BOOST_FOREACH( Type &actualTypeParameter, actualTypeParameters ) 73 99 { 74 actualTypeParameter.Resolve( resolver );100 actualTypeParameter.Resolve( resolver, resolveErrors ); 75 101 } 76 102 -
trunk/ab5.0/abdev/ab_common/src/Lexical/Member.cpp
r639 r640 41 41 } 42 42 43 bool Member::Resolve( const ObjectModule &resolver )43 bool Member::Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ) 44 44 { 45 type.Resolve( resolver );45 type.Resolve( resolver, resolveErrors ); 46 46 return true; 47 47 } -
trunk/ab5.0/abdev/ab_common/src/Lexical/Meta.cpp
r639 r640 253 253 } 254 254 255 void Meta::Resolve( const ObjectModule &resolver )255 void Meta::Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ) 256 256 { 257 257 // 関数・メソッド … … 261 261 { 262 262 UserProc *pUserProc = this->GetUserProcs().Iterator_GetNext(); 263 pUserProc->Resolve( resolver );263 pUserProc->Resolve( resolver, resolveErrors ); 264 264 } 265 265 … … 270 270 { 271 271 DllProc *pDllProc = this->GetDllProcs().Iterator_GetNext(); 272 pDllProc->Resolve( resolver );272 pDllProc->Resolve( resolver, resolveErrors ); 273 273 } 274 274 … … 279 279 { 280 280 CClass *pClass = this->GetClasses().Iterator_GetNext(); 281 pClass->Resolve( resolver );281 pClass->Resolve( resolver, resolveErrors ); 282 282 } 283 283 … … 285 285 BOOST_FOREACH( Variable *pVar, globalVars ) 286 286 { 287 pVar->Resolve( resolver );287 pVar->Resolve( resolver, resolveErrors ); 288 288 } 289 289 … … 294 294 { 295 295 CConst *pConst = this->GetGlobalConsts().Iterator_GetNext(); 296 pConst->Resolve( resolver );296 pConst->Resolve( resolver, resolveErrors ); 297 297 } 298 298 … … 303 303 { 304 304 ConstMacro *pConstMacro = this->GetGlobalConstMacros().Iterator_GetNext(); 305 pConstMacro->Resolve( resolver ); 305 pConstMacro->Resolve( resolver, resolveErrors ); 306 } 307 308 // blittable型 309 BOOST_FOREACH( BlittableType &blittableType, blittableTypes ) 310 { 311 blittableType.Resolve( resolver, resolveErrors ); 306 312 } 307 313 … … 309 315 BOOST_FOREACH( TypeDef &typeDef, typeDefs ) 310 316 { 311 typeDef.Resolve( resolver );317 typeDef.Resolve( resolver, resolveErrors ); 312 318 } 313 319 … … 315 321 BOOST_FOREACH( ProcPointer *pProcPointer, procPointers ) 316 322 { 317 pProcPointer->Resolve( resolver );323 pProcPointer->Resolve( resolver, resolveErrors ); 318 324 } 319 325 … … 324 330 { 325 331 Delegate *pDelegate = this->GetDelegates().Iterator_GetNext(); 326 pDelegate->Resolve( resolver );327 } 328 } 332 pDelegate->Resolve( resolver, resolveErrors ); 333 } 334 } -
trunk/ab5.0/abdev/ab_common/src/Lexical/Method.cpp
r639 r640 1 1 #include "stdafx.h" 2 2 3 bool CMethod::Resolve( const ObjectModule &resolver )3 bool CMethod::Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ) 4 4 { 5 if( pUserProc )5 if( this->pUserProc ) 6 6 { 7 if( pUserProc->IsNeedResolve() )7 if( this->pUserProc->IsNeedResolve() ) 8 8 { 9 pUserProc = resolver.meta.GetUserProcs().FindLike( pUserProc ); 9 const UserProc *pTempUserProc = resolver.meta.GetUserProcs().FindLike( this->pUserProc ); 10 if( pTempUserProc ) 11 { 12 this->pUserProc = pTempUserProc; 13 } 14 else 15 { 16 resolveErrors.Add( ResolveError( this->pUserProc->GetRelationalObjectModuleIndex(), this->pUserProc->GetFullName() ) ); 17 } 10 18 } 11 19 } … … 41 49 } 42 50 43 bool DynamicMethod::Resolve( const ObjectModule &resolver )51 bool DynamicMethod::Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ) 44 52 { 45 CMethod::Resolve( resolver );53 CMethod::Resolve( resolver, resolveErrors ); 46 54 47 55 if( this->pInheritsClass ) … … 49 57 if( this->pInheritsClass->IsNeedResolve() ) 50 58 { 51 this->pInheritsClass = resolver.meta.GetClasses().FindLike( pInheritsClass ); 59 const CClass *pTempClass = resolver.meta.GetClasses().FindLike( pInheritsClass ); 60 if( pTempClass ) 61 { 62 this->pInheritsClass = pTempClass; 63 } 64 else 65 { 66 resolveErrors.Add( ResolveError( this->pInheritsClass->GetRelationalObjectModuleIndex(), this->pInheritsClass->GetFullName() ) ); 67 } 52 68 } 53 69 } … … 62 78 } 63 79 64 bool StaticMethod::Resolve( const ObjectModule &resolver )80 bool StaticMethod::Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ) 65 81 { 66 CMethod::Resolve( resolver );82 CMethod::Resolve( resolver, resolveErrors ); 67 83 return true; 68 84 } -
trunk/ab5.0/abdev/ab_common/src/Lexical/NativeCode.cpp
r639 r640 19 19 } 20 20 21 bool Schedule::Resolve( const ObjectModule &resolver )21 bool Schedule::Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ) 22 22 { 23 23 switch( type ) … … 26 26 case AddressOf: 27 27 case CatchAddress: 28 if( pUserProc->IsNeedResolve() ) 29 { 30 pUserProc = resolver.meta.GetUserProcs().FindLike( pUserProc ); 28 if( this->pUserProc->IsNeedResolve() ) 29 { 30 const ::UserProc *pTempUserProc = resolver.meta.GetUserProcs().FindLike( this->pUserProc ); 31 if( pTempUserProc ) 32 { 33 this->pUserProc = pTempUserProc; 34 } 35 else 36 { 37 resolveErrors.Add( ResolveError( this->pUserProc->GetRelationalObjectModuleIndex(), this->pUserProc->GetFullName() ) ); 38 } 31 39 } 32 40 break; 33 41 case DllProc: 34 if( pDllProc->IsNeedResolve() ) 35 { 36 pDllProc = resolver.meta.GetDllProcs().FindLike( pDllProc ); 42 if( this->pDllProc->IsNeedResolve() ) 43 { 44 const ::DllProc *pTempDllProc = resolver.meta.GetDllProcs().FindLike( this->pDllProc ); 45 if( pTempDllProc ) 46 { 47 this->pDllProc = pTempDllProc; 48 } 49 else 50 { 51 resolveErrors.Add( ResolveError( this->pDllProc->GetRelationalObjectModuleIndex(), this->pDllProc->GetFullName() ) ); 52 } 37 53 } 38 54 break; … … 40 56 case Vtbl: 41 57 case TypeInfo: 42 if( pClass->IsNeedResolve() ) 43 { 44 pClass = resolver.meta.GetClasses().FindLike( pClass ); 58 if( this->pClass->IsNeedResolve() ) 59 { 60 const CClass *pTempClass = resolver.meta.GetClasses().FindLike( this->pClass ); 61 if( pTempClass ) 62 { 63 this->pClass = pTempClass; 64 } 65 else 66 { 67 resolveErrors.Add( ResolveError( this->pClass->GetRelationalObjectModuleIndex(), this->pClass->GetFullName() ) ); 68 } 45 69 } 46 70 break; … … 191 215 } 192 216 193 void NativeCode::Resolve( const ObjectModule &resolver )217 void NativeCode::Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ) 194 218 { 195 219 BOOST_FOREACH( Schedule &schedule, schedules ) 196 220 { 197 schedule.Resolve( resolver );198 } 199 } 221 schedule.Resolve( resolver, resolveErrors ); 222 } 223 } -
trunk/ab5.0/abdev/ab_common/src/Lexical/ObjectModule.cpp
r639 r640 77 77 } 78 78 79 // 依存関係を解決80 this->Resolve();81 82 79 // TODO: basbufがいらなくなったら消す 83 80 extern char *basbuf; … … 85 82 } 86 83 87 void ObjectModule::Resolve( )88 { 89 this->meta.Resolve( *this );84 void ObjectModule::Resolve( ResolveErrors &resolveErrors ) 85 { 86 this->meta.Resolve( *this, resolveErrors ); 90 87 91 88 // グローバルネイティブコードを解決(スケジュールを解決する) 92 this->globalNativeCode.Resolve( *this );89 this->globalNativeCode.Resolve( *this, resolveErrors ); 93 90 94 91 // データテーブルを解決(スケジュールを解決する) 95 this->dataTable.Resolve( *this );92 this->dataTable.Resolve( *this, resolveErrors ); 96 93 } 97 94 -
trunk/ab5.0/abdev/ab_common/src/Lexical/Procedure.cpp
r639 r640 12 12 } 13 13 14 bool Procedure::Resolve( const ObjectModule &resolver )14 bool Procedure::Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ) 15 15 { 16 16 BOOST_FOREACH( Parameter *pParameter, params ) 17 17 { 18 pParameter->Resolve( resolver );19 } 20 21 returnType.Resolve( resolver );18 pParameter->Resolve( resolver, resolveErrors ); 19 } 20 21 returnType.Resolve( resolver, resolveErrors ); 22 22 23 23 return true; … … 170 170 } 171 171 172 bool UserProc::Resolve( const ObjectModule &resolver ) 173 { 174 Procedure::Resolve( resolver ); 175 176 if( pParentClass ) 177 { 178 if( pParentClass->IsNeedResolve() ) 179 { 180 pParentClass = resolver.meta.GetClasses().FindLike( pParentClass ); 172 bool UserProc::Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ) 173 { 174 Procedure::Resolve( resolver, resolveErrors ); 175 176 if( this->pParentClass ) 177 { 178 if( this->pParentClass->IsNeedResolve() ) 179 { 180 const CClass *pTempClass = resolver.meta.GetClasses().FindLike( this->pParentClass ); 181 if( pTempClass ) 182 { 183 this->pParentClass = pTempClass; 184 } 185 else 186 { 187 resolveErrors.Add( ResolveError( this->pParentClass->GetRelationalObjectModuleIndex(), this->pParentClass->GetFullName() ) ); 188 } 181 189 } 182 190 } … … 184 192 if( pInterface ) 185 193 { 186 const_cast<Interface *>(pInterface)->Resolve( resolver );194 const_cast<Interface *>(pInterface)->Resolve( resolver, resolveErrors ); 187 195 } 188 196 189 197 if( pMethod ) 190 198 { 191 pMethod->Resolve( resolver );199 pMethod->Resolve( resolver, resolveErrors ); 192 200 } 193 201 194 202 BOOST_FOREACH( Parameter *pParameter, realParams ) 195 203 { 196 pParameter->Resolve( resolver );204 pParameter->Resolve( resolver, resolveErrors ); 197 205 } 198 206 199 207 BOOST_FOREACH( Variable *pLocalVar, localVars ) 200 208 { 201 pLocalVar->Resolve( resolver );202 } 203 204 nativeCode.Resolve( resolver );209 pLocalVar->Resolve( resolver, resolveErrors ); 210 } 211 212 nativeCode.Resolve( resolver, resolveErrors ); 205 213 return true; 206 214 } … … 228 236 } 229 237 230 bool DllProc::Resolve( const ObjectModule &resolver )231 { 232 Procedure::Resolve( resolver );233 return true; 234 } 235 236 bool ProcPointer::Resolve( const ObjectModule &resolver )237 { 238 Procedure::Resolve( resolver );238 bool DllProc::Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ) 239 { 240 Procedure::Resolve( resolver, resolveErrors ); 241 return true; 242 } 243 244 bool ProcPointer::Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ) 245 { 246 Procedure::Resolve( resolver, resolveErrors ); 239 247 return true; 240 248 } -
trunk/ab5.0/abdev/ab_common/src/Lexical/Template.cpp
r639 r640 9 9 } 10 10 11 bool ExpandedTemplateClass::Resolve( const ObjectModule &resolver )11 bool ExpandedTemplateClass::Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ) 12 12 { 13 13 if( pClass->IsNeedResolve() ) 14 14 { 15 pClass = const_cast<CClass *>(resolver.meta.GetClasses().FindLike( pClass )); 15 CClass *pTempClass = const_cast<CClass *>(resolver.meta.GetClasses().FindLike( pClass )); 16 if( pTempClass ) 17 { 18 this->pClass = pTempClass; 19 } 20 else 21 { 22 resolveErrors.Add( ResolveError( this->pClass->GetRelationalObjectModuleIndex(), this->pClass->GetFullName() ) ); 23 } 16 24 } 17 25 18 26 BOOST_FOREACH( Type &actualType, actualTypes ) 19 27 { 20 actualType.Resolve( resolver );28 actualType.Resolve( resolver, resolveErrors ); 21 29 } 22 30 -
trunk/ab5.0/abdev/ab_common/src/Lexical/Type.cpp
r639 r640 129 129 bool Type::Equals( const Type &type ) const 130 130 { 131 if( basicType == type.basicType ){ 132 if( NATURAL_TYPE( basicType ) == DEF_OBJECT 133 || NATURAL_TYPE( basicType ) == DEF_STRUCT ){ 134 135 if( index == type.index ){ 131 if( basicType == type.basicType ) 132 { 133 if( NATURAL_TYPE( basicType ) == DEF_OBJECT || NATURAL_TYPE( basicType ) == DEF_STRUCT ) 134 { 135 // ポインタが等しいかどうかを見てみる 136 if( this->pClass == type.pClass ) 137 { 138 return true; 139 } 140 else if( this->pClass->IsNeedResolve() || type.pClass->IsNeedResolve() ) 141 { 142 // 依存関係解決前の状態であれば、パスが等しいかどうかを見てみる 143 if( this->pClass->IsDuplication( type.pClass ) ) 144 { 136 145 return true; 137 146 } 138 139 } 140 else{ 147 } 148 } 149 else 150 { 141 151 return true; 142 152 } … … 556 566 } 557 567 558 bool Type::Resolve( const ObjectModule &resolver )568 bool Type::Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ) 559 569 { 560 570 if( this->HasMember() ) … … 562 572 if( this->pClass->IsNeedResolve() ) 563 573 { 564 this->pClass = resolver.meta.GetClasses().FindLike( this->pClass ); 574 const CClass *pTempClass = resolver.meta.GetClasses().FindLike( this->pClass ); 575 if( pTempClass ) 576 { 577 this->pClass = pTempClass; 578 } 579 else 580 { 581 resolveErrors.Add( ResolveError( this->pClass->GetRelationalObjectModuleIndex(), this->pClass->GetFullName() ) ); 582 } 565 583 } 566 584 567 585 BOOST_FOREACH( GenericType &actualGenericType, actualGenericTypes ) 568 586 { 569 actualGenericType.GetType().Resolve( resolver );587 actualGenericType.GetType().Resolve( resolver, resolveErrors ); 570 588 } 571 589 } … … 655 673 return pClass->GetNamespaceScopes().ToString() + "." + pClass->GetName() + "._Create"; 656 674 } 675 676 bool BlittableType::Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ) 677 { 678 basicType.Resolve( resolver, resolveErrors ); 679 680 if( this->pClass->IsNeedResolve() ) 681 { 682 const CClass *pTempClass = resolver.meta.GetClasses().FindLike( this->pClass ); 683 if( pTempClass ) 684 { 685 this->pClass = pTempClass; 686 } 687 else 688 { 689 resolveErrors.Add( ResolveError( this->pClass->GetRelationalObjectModuleIndex(), this->pClass->GetFullName() ) ); 690 } 691 } 692 693 return true; 694 } -
trunk/ab5.0/abdev/ab_common/src/Lexical/TypeDef.cpp
r639 r640 8 8 } 9 9 10 bool TypeDef::Resolve( const ObjectModule &resolver )10 bool TypeDef::Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ) 11 11 { 12 this->baseType.Resolve( resolver );12 this->baseType.Resolve( resolver, resolveErrors ); 13 13 return true; 14 14 } -
trunk/ab5.0/abdev/ab_common/src/Lexical/Variable.cpp
r639 r640 28 28 } 29 29 30 bool Variable::Resolve( const ObjectModule &resolver )30 bool Variable::Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ) 31 31 { 32 this->type.Resolve( resolver );32 this->type.Resolve( resolver, resolveErrors ); 33 33 return true; 34 34 } -
trunk/ab5.0/abdev/abdev/src/MainFrame.cpp
r637 r640 1374 1374 hChild=hCompileView; 1375 1375 hCompileView=(HWND)-1; 1376 SendMessage(hChild,WM_COMMAND,IDCANCEL,0); 1376 if( ::IsWindow( hChild ) ) 1377 { 1378 SendMessage(hChild,WM_COMMAND,IDCANCEL,0); 1379 } 1377 1380 } 1378 1381 -
trunk/ab5.0/abdev/compiler_x86/MakePeHdr.cpp
r637 r640 122 122 compiler.PreStaticLink( compiler.staticLibraries ); 123 123 compiler.StaticLink( compiler.staticLibraries ); 124 125 // 依存関係の解決 126 ActiveBasic::Common::Lexical::ResolveErrors resolveErrors; 127 compiler.GetObjectModule().Resolve( resolveErrors ); 128 BOOST_FOREACH( const ResolveError &resolveError, resolveErrors ) 129 { 130 compiler.errorMessenger.Output( ErrorInfo( 13, resolveError.GetTargetItemName(), -1 ) ); 131 } 124 132 125 133
Note:
See TracChangeset
for help on using the changeset viewer.