Changeset 182 in dev for trunk/abdev/BasicCompiler_Common/DebugMiddleFile.cpp
- Timestamp:
- Jun 24, 2007, 6:49:13 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/DebugMiddleFile.cpp
r159 r182 1 #include <jenga/include/smoothie/Smoothie.h> 2 3 #include <ClassImpl.h> 4 1 5 #include "../BasicCompiler_Common/common.h" 2 6 … … 28 32 (*p)+=lstrlen(buffer+(*p))+1; 29 33 30 type.SetIndex( (LONG_PTR) pobj_DBClass->Find(szClassName) );34 type.SetIndex( (LONG_PTR)Smoothie::GetMeta().GetClasses().Find(szClassName) ); 31 35 } 32 36 else{ … … 115 119 116 120 //イテレータをリセット 117 extern Classes *pobj_DBClass; 118 pobj_DBClass->Iterator_Reset(); 121 Smoothie::GetMeta().GetClasses().Iterator_Reset(); 119 122 120 123 //個数 121 *(long *)(buffer+i2)= pobj_DBClass->Iterator_GetMaxCount();122 i2+=sizeof(long); 123 124 while( pobj_DBClass->Iterator_HasNext()){124 *(long *)(buffer+i2)=Smoothie::GetMeta().GetClasses().Iterator_GetMaxCount(); 125 i2+=sizeof(long); 126 127 while(Smoothie::GetMeta().GetClasses().Iterator_HasNext()){ 125 128 CClass *pobj_c; 126 pobj_c= pobj_DBClass->Iterator_GetNext();129 pobj_c=Smoothie::GetMeta().GetClasses().Iterator_GetNext(); 127 130 128 131 //クラス名 … … 136 139 // TypeDef情報 137 140 ////////////////// 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() );141 *(long *)(buffer+i2)=(int)Smoothie::GetMeta().typeDefs.size(); 142 i2+=sizeof(long); 143 for(i3=0;i3<(int)Smoothie::GetMeta().typeDefs.size();i3++){ 144 lstrcpy(buffer+i2,Smoothie::GetMeta().typeDefs[i3].GetName().c_str() ); 145 i2+=lstrlen(buffer+i2)+1; 146 147 lstrcpy(buffer+i2,Smoothie::GetMeta().typeDefs[i3].GetBaseName().c_str() ); 145 148 i2+=lstrlen(buffer+i2)+1; 146 149 … … 156 159 *(long *)(buffer+i2)=(int)::globalVars.size(); 157 160 i2+=sizeof(long); 158 foreach( Variable *pVar, ::globalVars ){161 BOOST_FOREACH( Variable *pVar, ::globalVars ){ 159 162 //変数名 160 163 lstrcpy(buffer+i2,pVar->GetName().c_str()); … … 245 248 } 246 249 247 foreach( Variable *pVar, pUserProc->localVars ){250 BOOST_FOREACH( Variable *pVar, pUserProc->localVars ){ 248 251 lstrcpy(buffer+i2,pVar->GetName().c_str()); 249 252 i2+=lstrlen(buffer+i2)+1; … … 304 307 305 308 //イテレータをリセット 306 pobj_DBClass->Iterator_Reset();307 308 while( pobj_DBClass->Iterator_HasNext()){309 Smoothie::GetMeta().GetClasses().Iterator_Reset(); 310 311 while(Smoothie::GetMeta().GetClasses().Iterator_HasNext()){ 309 312 CClass *pobj_c; 310 pobj_c= pobj_DBClass->Iterator_GetNext();313 pobj_c=Smoothie::GetMeta().GetClasses().Iterator_GetNext(); 311 314 312 315 … … 324 327 325 328 //メンバ 326 *(long *)(buffer+i2)=(int)pobj_c-> dynamicMembers.size();327 i2+=sizeof(long); 328 foreach( CMember *member, pobj_c->dynamicMembers){329 *(long *)(buffer+i2)=(int)pobj_c->GetDynamicMembers().size(); 330 i2+=sizeof(long); 331 BOOST_FOREACH( CMember *member, pobj_c->GetDynamicMembers() ){ 329 332 // 名前 330 333 lstrcpy(buffer+i2,member->GetName().c_str()); … … 353 356 354 357 //メソッド 355 *(long *)(buffer+i2)=(long)pobj_c-> methods.size();356 i2+=sizeof(long); 357 foreach( const CMethod *pMethod, pobj_c->methods){358 *(long *)(buffer+i2)=(long)pobj_c->GetMethods().size(); 359 i2+=sizeof(long); 360 BOOST_FOREACH( const CMethod *pMethod, pobj_c->GetMethods() ){ 358 361 *(Prototype::Accessibility *)(buffer+i2)=pMethod->GetAccessibility(); 359 362 i2+=sizeof(Prototype::Accessibility); … … 371 374 372 375 //静的メンバ 373 *(long *)(buffer+i2)=(long)pobj_c-> staticMembers.size();374 i2+=sizeof(long); 375 foreach( CMember *member, pobj_c->staticMembers){376 *(long *)(buffer+i2)=(long)pobj_c->GetStaticMembers().size(); 377 i2+=sizeof(long); 378 BOOST_FOREACH( CMember *member, pobj_c->GetStaticMembers() ){ 376 379 // 名前 377 380 lstrcpy(buffer+i2,member->GetName().c_str()); … … 432 435 char temp2[MAX_PATH],*temp5; 433 436 434 pobj_CompilingClass = NULL;437 Smoothie::Temp::pCompilingClass = NULL; 435 438 436 439 i2=0; … … 482 485 /////////////////////////////////////////// 483 486 484 this->pobj_DBClass=new Classes ();487 this->pobj_DBClass=new ClassesImpl(); 485 488 486 489 int iMaxClassCount; … … 490 493 //クラス名 491 494 // TODO: 名前空間が未完成 492 pobj_DBClass->AddClass(NamespaceScopes(),NamespaceScopesCollection(),buffer+i2,0); 493 i2+=lstrlen(buffer+i2)+1; 494 } 495 496 extern Classes *pobj_DBClass; 497 pobj_DBClass=this->pobj_DBClass; 495 this->pobj_DBClass->Add(NamespaceScopes(),NamespaceScopesCollection(),buffer+i2,0); 496 i2+=lstrlen(buffer+i2)+1; 497 } 498 499 Smoothie::GetMeta().SetClasses( this->pobj_DBClass ); 498 500 499 501 … … 503 505 504 506 //初期化 505 Smoothie:: meta.typeDefs.clear();507 Smoothie::GetMeta().typeDefs.clear(); 506 508 507 509 //個数を取得 … … 513 515 514 516 // 名前空間に未対応 515 Smoothie:: meta.typeDefs.push_back( TypeDef( NamespaceScopes(), temp5, buffer+i2) );517 Smoothie::GetMeta().typeDefs.push_back( TypeDef( NamespaceScopes(), temp5, buffer+i2, -1 ) ); 516 518 517 519 i2+=lstrlen(buffer+i2)+1; … … 590 592 const CClass *pClass = NULL; 591 593 if(szParentClassName[0]){ 592 pClass= pobj_DBClass->Find(szParentClassName);594 pClass=Smoothie::GetMeta().GetClasses().Find(szParentClassName); 593 595 } 594 596 … … 695 697 i2+=lstrlen(buffer+i2)+1; 696 698 697 pobj_c = const_cast<CClass *>( pobj_DBClass->Find(szClassName) );699 pobj_c = const_cast<CClass *>( Smoothie::GetMeta().GetClasses().Find(szClassName) ); 698 700 699 701 //仮想関数の数 … … 724 726 i2+=sizeof(Prototype::Accessibility); 725 727 726 CMember *member=new CMember( accessibility, name, type, false );728 CMember *member=new CMember( accessibility, name, type, false, "", "" ); 727 729 728 730 memcpy(member->SubScripts,buffer+i2,sizeof(int)*MAX_ARRAYDIM); 729 731 i2+=sizeof(int)*MAX_ARRAYDIM; 730 732 731 pobj_c-> dynamicMembers.push_back( member );733 pobj_c->GetDynamicMembers().push_back( member ); 732 734 } 733 735 … … 746 748 const CClass *pobj_InheritsClass = NULL; 747 749 if(szInherits[0]){ 748 pobj_InheritsClass= pobj_DBClass->Find(szInherits);750 pobj_InheritsClass=Smoothie::GetMeta().GetClasses().Find(szInherits); 749 751 } 750 752 … … 764 766 CMethod *pMethod = new DynamicMethod( pUserProc, accessibility, 0,0,false, pobj_InheritsClass); 765 767 766 pobj_c-> methods.push_back( pMethod );768 pobj_c->GetMethods().push_back( pMethod ); 767 769 } 768 770 … … 786 788 i2+=sizeof(Prototype::Accessibility); 787 789 788 CMember *member=new CMember( accessibility, name, type, false );790 CMember *member=new CMember( accessibility, name, type, false, "", "" ); 789 791 790 792 memcpy(member->SubScripts,buffer+i2,sizeof(int)*MAX_ARRAYDIM); 791 793 i2+=sizeof(int)*MAX_ARRAYDIM; 792 794 793 pobj_c-> staticMembers.push_back( member );795 pobj_c->GetStaticMembers().push_back( member ); 794 796 } 795 797 } … … 943 945 944 946 // クラス情報 945 extern Classes *pobj_DBClass; 946 pobj_DBClass=this->pobj_DBClass; 947 Smoothie::GetMeta().SetClasses( this->pobj_DBClass ); 947 948 948 949 //定数を取得 … … 979 980 980 981 //クラスに関するメモリを解放 981 delete pobj_DBClass;982 pobj_DBClass=0;982 delete this->pobj_DBClass; 983 this->pobj_DBClass=0; 983 984 984 985 //サブルーチン情報のメモリ解放 … … 992 993 993 994 //コードバッファを解放 994 HeapDefaultFree(OpBuffer);995 free(OpBuffer); 995 996 OpBuffer=0; 996 997
Note:
See TracChangeset
for help on using the changeset viewer.