Changeset 598 in dev for trunk/ab5.0/abdev/BasicCompiler_Common/src
- Timestamp:
- May 10, 2008, 8:16:16 PM (17 years ago)
- Location:
- trunk/ab5.0/abdev/BasicCompiler_Common/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/BasicCompiler_Common/src/Class.cpp
r597 r598 635 635 } 636 636 637 const CClass *Classes::FindEx( const NamespaceScopes &namespaceScopes, const std::string &name) const638 { 639 if( namespaceScopes.size() == 0 && name== "Object" )637 const CClass *Classes::FindEx( const Symbol &symbol ) const 638 { 639 if( symbol.GetNamespaceScopes().size() == 0 && symbol.GetName() == "Object" ) 640 640 { 641 641 return GetObjectClassPtr(); 642 642 } 643 else if( namespaceScopes.size() == 0 && name== "String" )643 else if( symbol.GetNamespaceScopes().size() == 0 && symbol.GetName() == "String" ) 644 644 { 645 645 return GetStringClassPtr(); … … 647 647 648 648 std::vector<const CClass *> classes; 649 const CClass *pClass = GetHashArrayElement( name.c_str() );649 const CClass *pClass = GetHashArrayElement( symbol.GetName().c_str() ); 650 650 while( pClass ) 651 651 { 652 if( pClass->IsEqualSymbol( namespaceScopes, name) ){652 if( pClass->IsEqualSymbol( symbol.GetNamespaceScopes(), symbol.GetName() ) ){ 653 653 //名前空間とクラス名が一致した 654 654 classes.push_back( pClass ); … … 674 674 return NULL; 675 675 } 676 const CClass *Classes::FindEx( const std::string &fullName ) const677 {678 char AreaName[VN_SIZE] = ""; //オブジェクト変数679 char NestName[VN_SIZE] = ""; //入れ子メンバ680 bool isNest = SplitMemberName( fullName.c_str(), AreaName, NestName );681 682 return FindEx( NamespaceScopes( AreaName ), NestName );683 }684 676 685 677 const CClass *Classes::GetStringClassPtr() const … … 688 680 { 689 681 // キャッシュしておく 690 pStringClass = this->FindEx( NamespaceScopes( "System" ), "String");682 pStringClass = this->FindEx( Symbol( NamespaceScopes( "System" ), "String" ) ); 691 683 } 692 684 return pStringClass; … … 697 689 { 698 690 // キャッシュしておく 699 pObjectClass = this->FindEx( NamespaceScopes( "System" ), "Object");691 pObjectClass = this->FindEx( Symbol( NamespaceScopes( "System" ), "Object" ) ); 700 692 } 701 693 return pObjectClass; … … 706 698 { 707 699 // キャッシュしておく 708 pInterfaceInfo = this->FindEx( "ActiveBasic.Core.InterfaceInfo");700 pInterfaceInfo = this->FindEx( Symbol( NamespaceScopes( "ActiveBasic.Core" ), "InterfaceInfo" ) ); 709 701 } 710 702 return pInterfaceInfo; -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Compiler.cpp
r575 r598 3 3 #include <Compiler.h> 4 4 #include <Type.h> 5 6 using namespace ActiveBasic::Compiler; 5 7 6 8 Compiler compiler; … … 30 32 31 33 // ジェネリクスクラスを取得 32 const CClass *pGenericClass = this->GetObjectModule().meta.FindClassSupportedTypeDef( className ); 34 const CClass *pGenericClass = this->GetObjectModule().meta.FindClassSupportedTypeDef( 35 LexicalAnalyzer::FullNameToSymbol( className ) 36 ); 33 37 34 38 if( !pGenericClass ) … … 140 144 // TypeDefされた型 141 145 //////////////////// 142 int i=this->GetObjectModule().meta.GetTypeDefs().GetIndex( typeName);146 int i=this->GetObjectModule().meta.GetTypeDefs().GetIndex( LexicalAnalyzer::FullNameToSymbol( typeName ) ); 143 147 if(i!=-1){ 144 148 type = this->GetObjectModule().meta.GetTypeDefs()[i].GetBaseType(); … … 147 151 148 152 //クラス 149 const CClass *pobj_c = this->GetObjectModule().meta.GetClasses().FindEx( typeName);153 const CClass *pobj_c = this->GetObjectModule().meta.GetClasses().FindEx( LexicalAnalyzer::FullNameToSymbol( typeName ) ); 150 154 if(pobj_c){ 151 155 if( pobj_c->IsStructure() ){ -
trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer_Class.cpp
r574 r598 472 472 473 473 //継承元クラスを取得 474 const CClass *pInheritsClass = compiler.GetObjectModule().meta.FindClassSupportedTypeDef(className); 474 const CClass *pInheritsClass = compiler.GetObjectModule().meta.FindClassSupportedTypeDef( 475 LexicalAnalyzer::FullNameToSymbol( className ) 476 ); 475 477 if( !pInheritsClass ){ 476 478 compiler.errorMessenger.Output(106,className,nowLine); … … 640 642 641 643 //継承元クラスを取得 642 const CClass *pInterfaceClass = compiler.GetObjectModule().meta.FindClassSupportedTypeDef( className ); 644 const CClass *pInterfaceClass = compiler.GetObjectModule().meta.FindClassSupportedTypeDef( 645 LexicalAnalyzer::FullNameToSymbol( className ) 646 ); 643 647 if( !pInterfaceClass ){ 644 648 compiler.errorMessenger.Output(106,paramStr.c_str(),nowLine); … … 768 772 SplitGenericClassInstance( temporary, className, typeParameters, true, &typeParameterBaseClassNames ); 769 773 770 CClass *pobj_c = const_cast<CClass *>( classes.FindEx( namespaceScopes, className) );774 CClass *pobj_c = const_cast<CClass *>( classes.FindEx( Symbol( namespaceScopes, className ) ) ); 771 775 if(!pobj_c) continue; 772 776 … … 835 839 836 840 //継承元クラスを取得 837 const CClass *pInheritsClass = compiler.GetObjectModule().meta.FindClassSupportedTypeDef( temporary ); 841 const CClass *pInheritsClass = compiler.GetObjectModule().meta.FindClassSupportedTypeDef( 842 LexicalAnalyzer::FullNameToSymbol( temporary ) 843 ); 838 844 if( !pInheritsClass ){ 839 845 compiler.errorMessenger.Output(106,temporary,i); … … 1003 1009 SplitGenericClassInstance( temporary, className, typeParameters, true, &typeParameterBaseClassNames ); 1004 1010 1005 CClass *pobj_c = const_cast<CClass *>( classes.FindEx( namespaceScopes, className) );1011 CClass *pobj_c = const_cast<CClass *>( classes.FindEx( Symbol( namespaceScopes, className ) ) ); 1006 1012 if(!pobj_c) continue; 1007 1013 -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Meta.cpp
r597 r598 177 177 } 178 178 179 const CClass *Meta::FindClassSupportedTypeDef( const NamespaceScopes &namespaceScopes, const std::string &name)179 const CClass *Meta::FindClassSupportedTypeDef( const Symbol &symbol ) 180 180 { 181 const CClass *pClass = this->GetClasses().FindEx( namespaceScopes, name);181 const CClass *pClass = this->GetClasses().FindEx( symbol ); 182 182 if( pClass ) 183 183 { … … 186 186 187 187 // TypeDefも見る 188 int index = this->GetTypeDefs().GetIndex( namespaceScopes, name);188 int index = this->GetTypeDefs().GetIndex( symbol ); 189 189 if( index != -1 ){ 190 190 Type type = this->GetTypeDefs()[index].GetBaseType(); … … 196 196 return NULL; 197 197 } 198 const CClass *Meta::FindClassSupportedTypeDef( const std::string &fullName )199 {200 char AreaName[VN_SIZE] = ""; //オブジェクト変数201 char NestName[VN_SIZE] = ""; //入れ子メンバ202 bool isNest = SplitMemberName( fullName.c_str(), AreaName, NestName );203 204 return FindClassSupportedTypeDef( NamespaceScopes( AreaName ), NestName );205 } -
trunk/ab5.0/abdev/BasicCompiler_Common/src/TypeDef.cpp
r597 r598 17 17 } 18 18 19 int TypeDefCollection::GetIndex( const NamespaceScopes &namespaceScopes, const std::string &name) const{19 int TypeDefCollection::GetIndex( const Symbol &symbol ) const{ 20 20 int max = (int)(*this).size(); 21 21 for( int i=0; i<max; i++ ){ 22 if( (*this)[i].IsEqualSymbol( namespaceScopes, name) ){22 if( (*this)[i].IsEqualSymbol( symbol ) ){ 23 23 return i; 24 24 } … … 26 26 return -1; 27 27 } 28 int TypeDefCollection::GetIndex( const std::string &fullName ) const{29 char AreaName[VN_SIZE] = ""; //オブジェクト変数30 char NestName[VN_SIZE] = ""; //入れ子メンバ31 bool isNest = SplitMemberName( fullName.c_str(), AreaName, NestName );32 33 return GetIndex( NamespaceScopes( AreaName ), NestName );34 }
Note:
See TracChangeset
for help on using the changeset viewer.