Changeset 566 in dev for trunk/ab5.0/abdev/BasicCompiler_Common/src
- Timestamp:
- May 6, 2008, 1:41:03 PM (17 years ago)
- Location:
- trunk/ab5.0/abdev/BasicCompiler_Common/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/BasicCompiler_Common/src/Class.cpp
r565 r566 648 648 } 649 649 650 const CClass *Classes::Find( const NamespaceScopes &namespaceScopes, const std::string &name ) const 651 { 652 if( namespaceScopes.size() == 0 && name == "Object" ){ 650 const CClass *Classes::FindEx( const NamespaceScopes &namespaceScopes, const std::string &name ) const 651 { 652 if( namespaceScopes.size() == 0 && name == "Object" ) 653 { 653 654 return GetObjectClassPtr(); 654 655 } 655 else if( namespaceScopes.size() == 0 && name == "String" ){ 656 else if( namespaceScopes.size() == 0 && name == "String" ) 657 { 656 658 return GetStringClassPtr(); 657 659 } … … 683 685 } 684 686 685 // TypeDefも見る686 int index = compiler.GetObjectModule().meta.GetTypeDefs().GetIndex( namespaceScopes, name );687 if( index != -1 ){688 Type type = compiler.GetObjectModule().meta.GetTypeDefs()[index].GetBaseType();689 if( type.IsObject() ){690 return &type.GetClass();691 }692 }693 694 687 return NULL; 695 688 } 696 const CClass *Classes::Find ( const std::string &fullName ) const689 const CClass *Classes::FindEx( const std::string &fullName ) const 697 690 { 698 691 char AreaName[VN_SIZE] = ""; //オブジェクト変数 … … 700 693 bool isNest = SplitMemberName( fullName.c_str(), AreaName, NestName ); 701 694 702 return Find ( NamespaceScopes( AreaName ), NestName );695 return FindEx( NamespaceScopes( AreaName ), NestName ); 703 696 } 704 697 … … 707 700 if( !pStringClass ){ 708 701 // キャッシュしておく 709 pStringClass = this->Find ( NamespaceScopes( "System" ), "String" );702 pStringClass = this->FindEx( NamespaceScopes( "System" ), "String" ); 710 703 711 704 if( !pStringClass ) … … 723 716 if( !pObjectClass ){ 724 717 // キャッシュしておく 725 pObjectClass = this->Find ( NamespaceScopes( "System" ), "Object" );718 pObjectClass = this->FindEx( NamespaceScopes( "System" ), "Object" ); 726 719 727 720 if( !pObjectClass ) … … 739 732 if( !pInterfaceInfo ){ 740 733 // キャッシュしておく 741 pInterfaceInfo = this->Find ( "ActiveBasic.Core.InterfaceInfo" );734 pInterfaceInfo = this->FindEx( "ActiveBasic.Core.InterfaceInfo" ); 742 735 743 736 if( !pInterfaceInfo ) -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Compiler.cpp
r540 r566 30 30 31 31 // ジェネリクスクラスを取得 32 const CClass *pGenericClass = this->GetObjectModule().meta. GetClasses().Find( className );32 const CClass *pGenericClass = this->GetObjectModule().meta.FindClassSupportedTypeDef( className ); 33 33 34 34 if( !pGenericClass ) … … 128 128 129 129 //クラス 130 const CClass *pobj_c = this->GetObjectModule().meta.GetClasses().Find ( typeName );130 const CClass *pobj_c = this->GetObjectModule().meta.GetClasses().FindEx( typeName ); 131 131 if(pobj_c){ 132 132 if( pobj_c->IsStructure() ){ -
trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer_Class.cpp
r564 r566 472 472 473 473 //継承元クラスを取得 474 const CClass *pInheritsClass = compiler.GetObjectModule().meta. GetClasses().Find(className);474 const CClass *pInheritsClass = compiler.GetObjectModule().meta.FindClassSupportedTypeDef(className); 475 475 if( !pInheritsClass ){ 476 476 compiler.errorMessenger.Output(106,className,nowLine); … … 628 628 629 629 //継承元クラスを取得 630 const CClass *pInterfaceClass = compiler.GetObjectModule().meta. GetClasses().Find( className );630 const CClass *pInterfaceClass = compiler.GetObjectModule().meta.FindClassSupportedTypeDef( className ); 631 631 if( !pInterfaceClass ){ 632 632 compiler.errorMessenger.Output(106,paramStr.c_str(),nowLine); … … 756 756 SplitGenericClassInstance( temporary, className, typeParameters, true, &typeParameterBaseClassNames ); 757 757 758 CClass *pobj_c = const_cast<CClass *>( classes.Find (namespaceScopes, className) );758 CClass *pobj_c = const_cast<CClass *>( classes.FindEx(namespaceScopes, className) ); 759 759 if(!pobj_c) continue; 760 760 … … 823 823 824 824 //継承元クラスを取得 825 const CClass *pInheritsClass = c lasses.Find(temporary);825 const CClass *pInheritsClass = compiler.GetObjectModule().meta.FindClassSupportedTypeDef( temporary ); 826 826 if( !pInheritsClass ){ 827 827 compiler.errorMessenger.Output(106,temporary,i); … … 980 980 SplitGenericClassInstance( temporary, className, typeParameters, true, &typeParameterBaseClassNames ); 981 981 982 CClass *pobj_c = const_cast<CClass *>( classes.Find (namespaceScopes, className) );982 CClass *pobj_c = const_cast<CClass *>( classes.FindEx(namespaceScopes, className) ); 983 983 if(!pobj_c) continue; 984 984 -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Meta.cpp
r562 r566 178 178 throw; 179 179 } 180 181 const CClass *Meta::FindClassSupportedTypeDef( const NamespaceScopes &namespaceScopes, const std::string &name ) 182 { 183 const CClass *pClass = this->GetClasses().FindEx( namespaceScopes, name ); 184 if( pClass ) 185 { 186 return pClass; 187 } 188 189 // TypeDefも見る 190 int index = this->GetTypeDefs().GetIndex( namespaceScopes, name ); 191 if( index != -1 ){ 192 Type type = this->GetTypeDefs()[index].GetBaseType(); 193 if( type.IsObject() ){ 194 return &type.GetClass(); 195 } 196 } 197 198 return NULL; 199 } 200 const CClass *Meta::FindClassSupportedTypeDef( const std::string &fullName ) 201 { 202 char AreaName[VN_SIZE] = ""; //オブジェクト変数 203 char NestName[VN_SIZE] = ""; //入れ子メンバ 204 bool isNest = SplitMemberName( fullName.c_str(), AreaName, NestName ); 205 206 return FindClassSupportedTypeDef( NamespaceScopes( AreaName ), NestName ); 207 }
Note:
See TracChangeset
for help on using the changeset viewer.