Changeset 159 in dev for trunk/abdev/BasicCompiler_Common
- Timestamp:
- Jun 17, 2007, 4:44:57 AM (17 years ago)
- Location:
- trunk/abdev/BasicCompiler_Common
- Files:
-
- 1 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/Class.cpp
r143 r159 7 7 #endif 8 8 9 C DBClass *pobj_DBClass;9 Classes *pobj_DBClass; 10 10 11 11 const CClass *pobj_CompilingClass; … … 588 588 589 589 590 int C DBClass::hash(const char *name) const{590 int Classes::hash(const char *name) const{ 591 591 int key; 592 592 … … 598 598 } 599 599 600 void C DBClass::DestroyClass(CClass *pobj_c){600 void Classes::DestroyClass(CClass *pobj_c){ 601 601 if(pobj_c->pobj_NextClass){ 602 602 DestroyClass(pobj_c->pobj_NextClass); … … 606 606 } 607 607 608 C DBClass::CDBClass():608 Classes::Classes(): 609 609 pStringClass( NULL ), 610 610 pObjectClass( NULL ), … … 617 617 memset( pobj_ClassHash, 0, MAX_CLASS_HASH * sizeof(CClass *) ); 618 618 } 619 C DBClass::~CDBClass(){619 Classes::~Classes(){ 620 620 int i; 621 621 for(i=0;i<MAX_CLASS_HASH;i++){ … … 626 626 } 627 627 628 void C DBClass::ActionVtblSchedule(LONG_PTR ImageBase, LONG_PTR MemPos_CodeSection){628 void Classes::ActionVtblSchedule(LONG_PTR ImageBase, LONG_PTR MemPos_CodeSection){ 629 629 int i; 630 630 for(i=0;i<MAX_CLASS_HASH;i++){ … … 642 642 } 643 643 644 const CClass *C DBClass::Find( const NamespaceScopes &namespaceScopes, const string &name ) const644 const CClass *Classes::Find( const NamespaceScopes &namespaceScopes, const string &name ) const 645 645 { 646 646 int key; … … 669 669 670 670 // TypeDefも見る 671 int index = Smoothie:: Meta::typeDefs.GetIndex( namespaceScopes, name );671 int index = Smoothie::meta.typeDefs.GetIndex( namespaceScopes, name ); 672 672 if( index != -1 ){ 673 Type type = Smoothie:: Meta::typeDefs[index].GetBaseType();673 Type type = Smoothie::meta.typeDefs[index].GetBaseType(); 674 674 if( type.IsObject() ){ 675 675 return &type.GetClass(); … … 679 679 return NULL; 680 680 } 681 const CClass *C DBClass::Find( const string &fullName ) const681 const CClass *Classes::Find( const string &fullName ) const 682 682 { 683 683 char AreaName[VN_SIZE] = ""; //オブジェクト変数 … … 688 688 } 689 689 690 CClass *C DBClass::AddClass( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const char *name,int nowLine){690 CClass *Classes::AddClass( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const char *name,int nowLine){ 691 691 ////////////////////////////////////////////////////////////////////////// 692 692 // クラスを追加 … … 735 735 } 736 736 737 void C DBClass::InitNames(void){737 void Classes::InitNames(void){ 738 738 extern char *basbuf; 739 739 int i, i2; … … 741 741 742 742 // Blittable型管理オブジェクトを初期化 743 Smoothie:: Meta::blittableTypes.clear();743 Smoothie::meta.blittableTypes.clear(); 744 744 745 745 // 名前空間管理 … … 858 858 859 859 // Blittable型として登録 860 Smoothie:: Meta::blittableTypes.push_back( BlittableType( blittableType, pClass ) );861 } 862 } 863 } 864 } 865 866 867 void C DBClass::AddMethod(CClass *pobj_c, Prototype::Accessibility accessibility, BOOL bStatic, bool isConst, bool isAbstract,860 Smoothie::meta.blittableTypes.push_back( BlittableType( blittableType, pClass ) ); 861 } 862 } 863 } 864 } 865 866 867 void Classes::AddMethod(CClass *pobj_c, Prototype::Accessibility accessibility, BOOL bStatic, bool isConst, bool isAbstract, 868 868 bool isVirtual, bool isOverride, char *buffer, int nowLine){ 869 869 int i,i2; … … 987 987 } 988 988 989 BOOL C DBClass::MemberVar_LoopRefCheck(const CClass &objClass){989 BOOL Classes::MemberVar_LoopRefCheck(const CClass &objClass){ 990 990 int i2,bRet=1; 991 991 BOOST_FOREACH( CMember *pMember, objClass.dynamicMembers ){ … … 1010 1010 } 1011 1011 1012 void C DBClass::GetClass_recur(const char *lpszInheritsClass){1012 void Classes::GetClass_recur(const char *lpszInheritsClass){ 1013 1013 extern char *basbuf; 1014 1014 int i,i2,i3,sub_address,top_pos; … … 1461 1461 } 1462 1462 1463 void C DBClass::GetAllClassInfo(void){1463 void Classes::GetAllClassInfo(void){ 1464 1464 //ループ継承チェック用のクラス 1465 1465 pobj_LoopRefCheck=new CLoopRefCheck(); … … 1475 1475 } 1476 1476 1477 void C DBClass::Compile_System_InitializeUserTypes(){1477 void Classes::Compile_System_InitializeUserTypes(){ 1478 1478 char temporary[VN_SIZE]; 1479 1479 … … 1604 1604 1605 1605 1606 CClass *C DBClass::GetStringClassPtr() const1606 CClass *Classes::GetStringClassPtr() const 1607 1607 { 1608 1608 if( !pStringClass ){ … … 1612 1612 return pStringClass; 1613 1613 } 1614 CClass *C DBClass::GetObjectClassPtr() const1614 CClass *Classes::GetObjectClassPtr() const 1615 1615 { 1616 1616 if( !pObjectClass ){ … … 1621 1621 } 1622 1622 1623 void C DBClass::StartCompile( UserProc *pUserProc ){1623 void Classes::StartCompile( UserProc *pUserProc ){ 1624 1624 pCompilingClass = pUserProc->GetParentClassPtr(); 1625 1625 if( pCompilingClass ){ … … 1638 1638 } 1639 1639 } 1640 const CClass *C DBClass::GetNowCompilingClass() const1640 const CClass *Classes::GetNowCompilingClass() const 1641 1641 { 1642 1642 return pCompilingClass; 1643 1643 } 1644 const CMethod *C DBClass::GetNowCompilingMethodInfo(){1644 const CMethod *Classes::GetNowCompilingMethodInfo(){ 1645 1645 return pCompilingMethod; 1646 1646 } … … 1653 1653 ////////////////////// 1654 1654 1655 void C DBClass::Iterator_Init(void){1655 void Classes::Iterator_Init(void){ 1656 1656 if(ppobj_IteClass) HeapDefaultFree(ppobj_IteClass); 1657 1657 … … 1676 1676 } 1677 1677 } 1678 void C DBClass::Iterator_Reset(void){1678 void Classes::Iterator_Reset(void){ 1679 1679 iIteNextNum = 0; 1680 1680 } 1681 BOOL C DBClass::Iterator_HasNext(void){1681 BOOL Classes::Iterator_HasNext(void){ 1682 1682 if(iIteNextNum<iIteMaxNum) return 1; 1683 1683 return 0; 1684 1684 } 1685 CClass *C DBClass::Iterator_GetNext(void){1685 CClass *Classes::Iterator_GetNext(void){ 1686 1686 CClass *pobj_c; 1687 1687 pobj_c=ppobj_IteClass[iIteNextNum]; … … 1689 1689 return pobj_c; 1690 1690 } 1691 int C DBClass::Iterator_GetMaxCount(void){1691 int Classes::Iterator_GetMaxCount(void){ 1692 1692 return iIteMaxNum; 1693 1693 } -
trunk/abdev/BasicCompiler_Common/Class.h
r141 r159 9 9 #include "Procedure.h" 10 10 11 class C DBClass;11 class Classes; 12 12 class CDebugSection; 13 13 class CClass; … … 35 35 { 36 36 friend CMember; 37 friend C DBClass;37 friend Classes; 38 38 friend CDebugSection; 39 39 … … 234 234 235 235 #define MAX_CLASS_HASH 65535 236 class C DBClass{236 class Classes{ 237 237 int hash(const char *name) const; 238 238 void DestroyClass(CClass *pobj_c); … … 240 240 CClass *pobj_ClassHash[MAX_CLASS_HASH]; 241 241 242 C DBClass();243 ~C DBClass();242 Classes(); 243 ~Classes(); 244 244 245 245 const CClass *Find( const string &fullName ) const; … … 301 301 302 302 303 extern C DBClass *pobj_DBClass;303 extern Classes *pobj_DBClass; 304 304 extern const CClass *pobj_CompilingClass; -
trunk/abdev/BasicCompiler_Common/DebugMiddleFile.cpp
r141 r159 115 115 116 116 //イテレータをリセット 117 extern C DBClass *pobj_DBClass;117 extern Classes *pobj_DBClass; 118 118 pobj_DBClass->Iterator_Reset(); 119 119 … … 136 136 // TypeDef情報 137 137 ////////////////// 138 *(long *)(buffer+i2)=(int)Smoothie:: Meta::typeDefs.size();139 i2+=sizeof(long); 140 for(i3=0;i3<(int)Smoothie:: Meta::typeDefs.size();i3++){141 lstrcpy(buffer+i2,Smoothie:: Meta::typeDefs[i3].GetName().c_str() );142 i2+=lstrlen(buffer+i2)+1; 143 144 lstrcpy(buffer+i2,Smoothie:: Meta::typeDefs[i3].GetBaseName().c_str() );138 *(long *)(buffer+i2)=(int)Smoothie::meta.typeDefs.size(); 139 i2+=sizeof(long); 140 for(i3=0;i3<(int)Smoothie::meta.typeDefs.size();i3++){ 141 lstrcpy(buffer+i2,Smoothie::meta.typeDefs[i3].GetName().c_str() ); 142 i2+=lstrlen(buffer+i2)+1; 143 144 lstrcpy(buffer+i2,Smoothie::meta.typeDefs[i3].GetBaseName().c_str() ); 145 145 i2+=lstrlen(buffer+i2)+1; 146 146 … … 482 482 /////////////////////////////////////////// 483 483 484 this->pobj_DBClass=new C DBClass();484 this->pobj_DBClass=new Classes(); 485 485 486 486 int iMaxClassCount; … … 494 494 } 495 495 496 extern C DBClass *pobj_DBClass;496 extern Classes *pobj_DBClass; 497 497 pobj_DBClass=this->pobj_DBClass; 498 498 … … 503 503 504 504 //初期化 505 Smoothie:: Meta::typeDefs.clear();505 Smoothie::meta.typeDefs.clear(); 506 506 507 507 //個数を取得 … … 513 513 514 514 // 名前空間に未対応 515 Smoothie:: Meta::typeDefs.push_back( TypeDef( NamespaceScopes(), temp5, buffer+i2 ) );515 Smoothie::meta.typeDefs.push_back( TypeDef( NamespaceScopes(), temp5, buffer+i2 ) ); 516 516 517 517 i2+=lstrlen(buffer+i2)+1; … … 943 943 944 944 // クラス情報 945 extern C DBClass *pobj_DBClass;945 extern Classes *pobj_DBClass; 946 946 pobj_DBClass=this->pobj_DBClass; 947 947 -
trunk/abdev/BasicCompiler_Common/DebugSection.h
r100 r159 32 32 33 33 // クラス情報 34 C DBClass *pobj_DBClass;34 Classes *pobj_DBClass; 35 35 36 36 //定数を取得 -
trunk/abdev/BasicCompiler_Common/Diagnose.cpp
r135 r159 63 63 64 64 // イテレータをリセット 65 extern C DBClass *pobj_DBClass;65 extern Classes *pobj_DBClass; 66 66 pobj_DBClass->Iterator_Reset(); 67 67 … … 103 103 104 104 // イテレータをリセット 105 extern C DBClass *pobj_DBClass;105 extern Classes *pobj_DBClass; 106 106 pobj_DBClass->Iterator_Reset(); 107 107 -
trunk/abdev/BasicCompiler_Common/NumOpe_GetType.cpp
r135 r159 323 323 Type leftType; 324 324 if( GetTermType( termLeft, leftType, isLiteral, &isClassName ) ){ 325 if( isClassName == false && Smoothie:: Meta::blittableTypes.IsExist( leftType ) ){325 if( isClassName == false && Smoothie::meta.blittableTypes.IsExist( leftType ) ){ 326 326 // 左側のオブジェクト部分がBlittable型のとき 327 327 … … 329 329 lstrcpy( temporary, termLeft ); 330 330 sprintf( termLeft, "%s(%s)", 331 Smoothie:: Meta::blittableTypes.Find( leftType ).GetCreateStaticMethodFullName().c_str(),331 Smoothie::meta.blittableTypes.Find( leftType ).GetCreateStaticMethodFullName().c_str(), 332 332 temporary ); 333 333 -
trunk/abdev/BasicCompiler_Common/Subroutine.cpp
r143 r159 199 199 GetVarType(fullCallName,type,false); 200 200 201 ProcPointer *pProcPtr = Smoothie:: Meta::procPointers[type.GetIndex()];201 ProcPointer *pProcPtr = Smoothie::meta.procPointers[type.GetIndex()]; 202 202 resultType = pProcPtr->ReturnType(); 203 203 … … 869 869 pProcPointer->SetParamsAndReturnType( paramStr.c_str(), nowLine ); 870 870 871 Smoothie:: Meta::procPointers.push_back( pProcPointer );872 873 return (int)Smoothie:: Meta::procPointers.size()-1;871 Smoothie::meta.procPointers.push_back( pProcPointer ); 872 873 return (int)Smoothie::meta.procPointers.size()-1; 874 874 } 875 875 void DeleteProcPtrInfo(void){ 876 BOOST_FOREACH( ProcPointer *pProcPointer, Smoothie:: Meta::procPointers ){876 BOOST_FOREACH( ProcPointer *pProcPointer, Smoothie::meta.procPointers ){ 877 877 delete pProcPointer; 878 878 } 879 879 880 Smoothie:: Meta::procPointers.clear();880 Smoothie::meta.procPointers.clear(); 881 881 } 882 882 -
trunk/abdev/BasicCompiler_Common/Type.cpp
r140 r159 102 102 // TypeDefされた型 103 103 //////////////////// 104 int i=Smoothie:: Meta::typeDefs.GetIndex( typeName );104 int i=Smoothie::meta.typeDefs.GetIndex( typeName ); 105 105 if(i!=-1){ 106 type = Smoothie:: Meta::typeDefs[i].GetBaseType();106 type = Smoothie::meta.typeDefs[i].GetBaseType(); 107 107 return true; 108 108 } … … 502 502 } 503 503 else{ 504 if( Smoothie:: Meta::procPointers[index]->ReturnType().IsNull() ){504 if( Smoothie::meta.procPointers[index]->ReturnType().IsNull() ){ 505 505 return "*Sub"; 506 506 } -
trunk/abdev/BasicCompiler_Common/VariableOpe.cpp
r140 r159 220 220 if(lpIndex==-1) lstrcpy(name,"VoidPtr"); 221 221 else{ 222 if( Smoothie:: Meta::procPointers[lpIndex]->ReturnType().IsNull() )222 if( Smoothie::meta.procPointers[lpIndex]->ReturnType().IsNull() ) 223 223 lstrcpy(name,"*Sub"); 224 224 else lstrcpy(name,"*Function"); … … 645 645 // 名前空間を分離 646 646 char namespaceStr[VN_SIZE]="", simpleName[VN_SIZE]; 647 Smoothie:: Meta::namespaceScopesCollection.SplitNamespace( variable, namespaceStr, simpleName );647 Smoothie::meta.namespaceScopesCollection.SplitNamespace( variable, namespaceStr, simpleName ); 648 648 649 649 // 先頭オブジェクトまたはクラス名と入れ子メンバに分割 … … 738 738 } 739 739 740 int typeDefIndex = Smoothie:: Meta::typeDefs.GetIndex( VarName );740 int typeDefIndex = Smoothie::meta.typeDefs.GetIndex( VarName ); 741 741 if( typeDefIndex != -1 ){ 742 742 // TypeDef後の型名だったとき 743 lstrcpy( VarName, Smoothie:: Meta::typeDefs[typeDefIndex].GetBaseName().c_str() );743 lstrcpy( VarName, Smoothie::meta.typeDefs[typeDefIndex].GetBaseName().c_str() ); 744 744 } 745 745 -
trunk/abdev/BasicCompiler_Common/include/Smoothie.h
r143 r159 2 2 3 3 #include "Source.h" 4 #include "../TypeDef.h" 5 #include "Namespace.h" 4 #include "ObjectModule.h" 6 5 7 6 class Smoothie{ … … 33 32 }; 34 33 35 // プロジェクト中に存在するメタ情報36 class Meta{37 public:38 // 名前空間39 static NamespaceScopesCollection namespaceScopesCollection;40 41 // クラス42 43 // TypeDef44 static TypeDefCollection typeDefs;45 46 // 関数ポインタ47 static vector<ProcPointer *> procPointers;48 49 // blittable型50 static BlittableTypes blittableTypes;51 };52 53 34 // コンパイル中に一時的に利用する 54 35 class Temp{ … … 58 39 }; 59 40 41 // プロジェクト中に存在するメタ情報 42 static Meta meta; 43 60 44 static bool isFullCompile; 61 45 }; -
trunk/abdev/BasicCompiler_Common/src/Member.cpp
r138 r159 57 57 58 58 //イテレータをリセット 59 extern C DBClass *pobj_DBClass;59 extern Classes *pobj_DBClass; 60 60 pobj_DBClass->Iterator_Reset(); 61 61 -
trunk/abdev/BasicCompiler_Common/src/Namespace.cpp
r143 r159 103 103 void NamespaceScopesCollection::Imports( const string &namespaceStr ){ 104 104 NamespaceScopes namespaceScopes( namespaceStr ); 105 if( !Smoothie:: Meta::namespaceScopesCollection.IsExist( namespaceScopes ) ){105 if( !Smoothie::meta.namespaceScopesCollection.IsExist( namespaceScopes ) ){ 106 106 SetError(64,namespaceStr.c_str(),cp ); 107 107 return; -
trunk/abdev/BasicCompiler_Common/src/Smoothie.cpp
r143 r159 19 19 NamespaceScopes Smoothie::Lexical::liveingNamespaceScopes; 20 20 21 TypeDefCollection Smoothie::Meta::typeDefs; 22 vector<ProcPointer *> Smoothie::Meta::procPointers; 23 NamespaceScopesCollection Smoothie::Meta::namespaceScopesCollection; 21 Meta Smoothie::meta; 24 22 NamespaceScopesCollection Smoothie::Temp::importedNamespaces; 25 BlittableTypes Smoothie::Meta::blittableTypes;26 23 27 24 bool Smoothie::isFullCompile = false;
Note:
See TracChangeset
for help on using the changeset viewer.