Changeset 598 in dev for trunk/ab5.0/abdev/BasicCompiler_Common
- Timestamp:
- May 10, 2008, 8:16:16 PM (17 years ago)
- Location:
- trunk/ab5.0/abdev/BasicCompiler_Common
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/BasicCompiler_Common/DebugMiddleFile.cpp
r587 r598 16 16 #define MDLFILE_VER 0x70000003 17 17 18 using namespace ActiveBasic::Compiler; 19 18 20 19 21 void SetLpIndex_DebugFile(char *buffer,int *p,const Type &type){ … … 35 37 (*p)+=lstrlen(buffer+(*p))+1; 36 38 37 type.SetClassPtr( compiler.GetObjectModule().meta.GetClasses().FindEx(szClassName) ); 39 type.SetClassPtr( 40 compiler.GetObjectModule().meta.GetClasses().FindEx( LexicalAnalyzer::FullNameToSymbol( szClassName ) ) 41 ); 38 42 } 39 43 else{ -
trunk/ab5.0/abdev/BasicCompiler_Common/NumOpe_GetType.cpp
r579 r598 5 5 #include "common.h" 6 6 7 using namespace ActiveBasic::Compiler; 7 8 8 9 int MakeWholeType(int size,int bSigned){ … … 468 469 if( pIsClassName ) 469 470 { 470 if( compiler.GetObjectModule().meta.FindClassSupportedTypeDef( termFull) )471 if( compiler.GetObjectModule().meta.FindClassSupportedTypeDef( LexicalAnalyzer::FullNameToSymbol( termFull ) ) ) 471 472 { 472 473 *pIsClassName = true; -
trunk/ab5.0/abdev/BasicCompiler_Common/VariableOpe.cpp
r579 r598 639 639 } 640 640 641 int typeDefIndex = compiler.GetObjectModule().meta.GetTypeDefs().GetIndex( VarName);641 int typeDefIndex = compiler.GetObjectModule().meta.GetTypeDefs().GetIndex( LexicalAnalyzer::FullNameToSymbol( VarName ) ); 642 642 if( typeDefIndex != -1 ){ 643 643 // TypeDef後の型名だったとき -
trunk/ab5.0/abdev/BasicCompiler_Common/calculation.cpp
r579 r598 1051 1051 1052 1052 if(((unsigned _int64)*pi64)<=UCHAR_MAX){ 1053 // 符号無し8ビット整数のリテラル値1053 // 符号無し8ビット整数のリテラル値 1054 1054 return DEF_BYTE; 1055 1055 } 1056 1056 else if(((unsigned _int64)*pi64)<=USHRT_MAX){ 1057 // 符号無し16ビット整数のリテラル値1057 // 符号無し16ビット整数のリテラル値 1058 1058 return DEF_WORD; 1059 1059 } 1060 1060 else if(((unsigned _int64)*pi64)<=UINT_MAX){ 1061 // 符号無し32ビット整数のリテラル値1061 // 符号無し32ビット整数のリテラル値 1062 1062 return DEF_DWORD; 1063 1063 } 1064 1064 else{ 1065 // 符号無し64ビット整数のリテラル値1065 // 符号無し64ビット整数のリテラル値 1066 1066 return DEF_QWORD; 1067 1067 } -
trunk/ab5.0/abdev/BasicCompiler_Common/hash.cpp
r576 r598 82 82 if( !pobj_c ) 83 83 { 84 pobj_c=compiler.GetObjectModule().meta.FindClassSupportedTypeDef(ObjName); 84 pobj_c = compiler.GetObjectModule().meta.FindClassSupportedTypeDef( 85 LexicalAnalyzer::FullNameToSymbol( ObjName ) 86 ); 85 87 if( pobj_c ){ 86 88 isStatic = true; … … 160 162 161 163 const UserProc *GetClassMethod( const char *className, const char *methodName ){ 162 const CClass *pClass = compiler.GetObjectModule().meta.FindClassSupportedTypeDef( className ); 164 const CClass *pClass = compiler.GetObjectModule().meta.FindClassSupportedTypeDef( 165 LexicalAnalyzer::FullNameToSymbol( className ) 166 ); 163 167 if( pClass ){ 164 168 std::vector<const UserProc *> userProcs; -
trunk/ab5.0/abdev/BasicCompiler_Common/include/Class.h
r593 r598 496 496 CClass *Add( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const char *name,int nowLine); 497 497 498 const CClass *FindEx( const NamespaceScopes &namespaceScopes, const std::string &name ) const; 499 const CClass *FindEx( const std::string &fullName ) const; 498 const CClass *FindEx( const Symbol &symbol ) const; 500 499 501 500 -
trunk/ab5.0/abdev/BasicCompiler_Common/include/Meta.h
r566 r598 156 156 const ::Delegate &ToDelegate( const CClass &_class ); 157 157 158 const CClass *FindClassSupportedTypeDef( const NamespaceScopes &namespaceScopes, const std::string &name ); 159 const CClass *FindClassSupportedTypeDef( const std::string &fullName ); 158 const CClass *FindClassSupportedTypeDef( const Symbol &symbol ); 160 159 }; -
trunk/ab5.0/abdev/BasicCompiler_Common/include/TypeDef.h
r542 r598 59 59 60 60 void Add( const NamespaceScopes &namespaceScopes, const std::string &name, const std::string &baseName, int nowLine ); 61 int GetIndex( const NamespaceScopes &namespaceScopes, const std::string &name ) const; 62 int GetIndex( const std::string &fullName ) const; 61 int GetIndex( const Symbol &symbol ) const; 63 62 }; -
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.