Changeset 100 in dev for BasicCompiler_Common/Subroutine.cpp
- Timestamp:
- Apr 24, 2007, 3:17:29 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/Subroutine.cpp
r99 r100 99 99 } 100 100 if( lastIndex == -1 ){ 101 lstrcpy( member, desc ); 101 102 return false; 102 103 } … … 298 299 //インデクサ(getter)の戻り値を取得 299 300 bool GetReturnTypeOfIndexerGetterProc( const CClass &objClass, Type &resultType ){ 300 std::vector<UserProc *> subs;301 vector<UserProc *> subs; 301 302 objClass.EnumMethod( CALC_ARRAY_GET, subs ); 302 303 if( subs.size() == 0 ){ … … 310 311 311 312 312 void AddDeclareData(c har *buffer,int nowLine){313 void AddDeclareData(const NamespaceScopes &namespaceScopes, char *buffer,int nowLine){ 313 314 extern HANDLE hHeap; 314 315 int i2; … … 401 402 402 403 // オブジェクトを生成 403 DllProc *pDllProc = new DllProc( procName, kind, isCdecl, dllFileName, alias );404 DllProc *pDllProc = new DllProc( namespaceScopes, procName, kind, isCdecl, dllFileName, alias ); 404 405 405 406 // パラメータを解析 … … 462 463 } 463 464 464 UserProc *AddSubData(char *buffer,int nowLine,BOOL bVirtual,CClass *pobj_c, bool isStatic){465 GlobalProc *AddSubData( const NamespaceScopes &namespaceScopes, char *buffer,int nowLine,BOOL bVirtual,CClass *pobj_c, bool isStatic){ 465 466 int i2,i3; 466 467 char temporary[8192]; … … 468 469 int i=1; 469 470 470 UserProc::Kind kind = Procedure::Sub;471 Procedure::Kind kind = Procedure::Sub; 471 472 bool isMacro = false; 472 473 if(buffer[i]==ESC_FUNCTION) kind = Procedure::Function; … … 583 584 SubNum++; 584 585 585 UserProc *pUserProc = new UserProc(temporary, kind, isMacro, isCdecl, isExport );586 GlobalProc *pUserProc = new GlobalProc( namespaceScopes, temporary, kind, isMacro, isCdecl, isExport ); 586 587 pUserProc->SetParentClass( pobj_c ); 587 588 … … 610 611 key=hash_default(pUserProc->GetName().c_str()); 611 612 612 extern UserProc **ppSubHash;613 extern GlobalProc **ppSubHash; 613 614 if(ppSubHash[key]){ 614 UserProc *psi2;615 GlobalProc *psi2; 615 616 psi2=ppSubHash[key]; 616 617 while(1){ … … 648 649 649 650 //サブルーチン(ユーザー定義)情報を初期化 650 extern UserProc **ppSubHash;651 extern GlobalProc **ppSubHash; 651 652 extern int SubNum; 652 ppSubHash=( UserProc **)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,MAX_HASH*sizeof(UserProc *));653 ppSubHash=(GlobalProc **)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,MAX_HASH*sizeof(GlobalProc *)); 653 654 SubNum=0; 654 655 … … 660 661 661 662 // 名前空間管理 662 vector<string>namespaceScopes;663 NamespaceScopes namespaceScopes; 663 664 664 665 i=-1; … … 715 716 if(basbuf[i]=='\0') break; 716 717 } 717 AddDeclareData( temporary,i);718 AddDeclareData(namespaceScopes,temporary,i); 718 719 719 720 continue; … … 728 729 if(basbuf[i]=='\0') break; 729 730 } 730 AddSubData( temporary,i,0,0);731 AddSubData(namespaceScopes,temporary,i,0,0); 731 732 732 733 continue; … … 743 744 // 特殊関数 744 745 //////////// 746 namespaceScopes.clear(); 745 747 746 748 sprintf(temporary,"%c%c_allrem()",1,ESC_SUB); 747 AddSubData( temporary,0,0,0);749 AddSubData( namespaceScopes, temporary,0,0,0); 748 750 749 751 sprintf(temporary,"%c%c_aullrem()",1,ESC_SUB); 750 AddSubData( temporary,0,0,0);752 AddSubData( namespaceScopes, temporary,0,0,0); 751 753 752 754 sprintf(temporary,"%c%c_allmul()",1,ESC_SUB); 753 AddSubData( temporary,0,0,0);755 AddSubData( namespaceScopes, temporary,0,0,0); 754 756 755 757 sprintf(temporary,"%c%c_alldiv()",1,ESC_SUB); 756 AddSubData( temporary,0,0,0);758 AddSubData( namespaceScopes, temporary,0,0,0); 757 759 758 760 sprintf(temporary,"%c%c_aulldiv()",1,ESC_SUB); 759 AddSubData( temporary,0,0,0);761 AddSubData( namespaceScopes, temporary,0,0,0); 760 762 761 763 sprintf(temporary,"%c%c_allshl()",1,ESC_SUB); 762 AddSubData( temporary,0,0,0);764 AddSubData( namespaceScopes, temporary,0,0,0); 763 765 764 766 sprintf(temporary,"%c%c_allshr()",1,ESC_SUB); 765 AddSubData( temporary,0,0,0);767 AddSubData( namespaceScopes, temporary,0,0,0); 766 768 767 769 sprintf(temporary,"%c%c_aullshr()",1,ESC_SUB); 768 AddSubData( temporary,0,0,0);770 AddSubData( namespaceScopes, temporary,0,0,0); 769 771 770 772 sprintf(temporary,"%c%c_System_InitStaticLocalVariables()",1,ESC_SUB); 771 AddSubData( temporary,0,0,0);772 } 773 void Delete_si( UserProc *pUserProc){773 AddSubData( namespaceScopes, temporary,0,0,0); 774 } 775 void Delete_si(GlobalProc *pUserProc){ 774 776 if(pUserProc->pNextData) Delete_si(pUserProc->pNextData); 775 777 delete pUserProc; 776 778 } 777 void DeleteSubInfo( UserProc **ppSubHash,char **ppMacroNames,int MacroNum){ //サブルーチン情報のメモリ解放779 void DeleteSubInfo(GlobalProc **ppSubHash,char **ppMacroNames,int MacroNum){ //サブルーチン情報のメモリ解放 778 780 int i; 779 781 for(i=0;i<MAX_HASH;i++){ … … 845 847 bool IsNeedProcCompile(){ 846 848 for(int i2=0;i2<MAX_HASH;i2++){ 847 extern UserProc **ppSubHash;848 UserProc *pUserProc=ppSubHash[i2];849 extern GlobalProc **ppSubHash; 850 GlobalProc *pUserProc=ppSubHash[i2]; 849 851 while(pUserProc){ 850 852 if( pUserProc->IsUsing() && pUserProc->IsCompiled() == false ){
Note:
See TracChangeset
for help on using the changeset viewer.