Changeset 108 in dev
- Timestamp:
- May 6, 2007, 6:52:10 PM (18 years ago)
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler32/BasicCompiler.vcproj
r107 r108 75 75 <Tool 76 76 Name="VCLinkerTool" 77 AdditionalDependencies=" odbc32.lib odbccp32.lib comctl32.lib"77 AdditionalDependencies="comctl32.lib psapi.lib" 78 78 OutputFile="../ActiveBasic/BasicCompiler32.exe" 79 79 LinkIncremental="2" -
BasicCompiler32/Compile_ProcOp.cpp
r101 r108 269 269 // コンパイル中の関数が属する名前空間 270 270 Smoothie::Lexical::liveingNamespaceScopes = pUserProc->GetNamespaceScopes(); 271 272 // コンパイル中の関数でImportsされている名前空間 273 Smoothie::Meta::importedNamespaces = pUserProc->GetImportedNamespaces(); 271 274 272 275 if(pUserProc->IsSystem()){ -
BasicCompiler64/Compile_ProcOp.cpp
r101 r108 259 259 // コンパイル中の関数が属する名前空間 260 260 Smoothie::Lexical::liveingNamespaceScopes = pUserProc->GetNamespaceScopes(); 261 262 // コンパイル中の関数でImportsされている名前空間 263 Smoothie::Meta::importedNamespaces = pUserProc->GetImportedNamespaces(); 261 264 262 265 if(pUserProc->IsSystem()){ -
BasicCompiler_Common/Class.cpp
r106 r108 148 148 149 149 150 CClass::CClass( const NamespaceScopes &namespaceScopes, const char *name ): 151 namespaceScopes( namespaceScopes ), 152 ConstructorMemberSubIndex( 0 ), 153 DestructorMemberSubIndex( 0 ), 154 classType( Class ), 155 isUsing( false ), 156 pobj_InheritsClass( NULL ), 157 ppobj_Member( NULL ), 158 iMemberNum( 0 ), 159 vtbl_num( 0 ), 160 iAlign( 0 ), 161 vtbl_offset( -1 ), 162 isCompilingConstructor( false ), 163 isCompilingDestructor( false ), 164 pobj_NextClass( NULL ) 150 CClass::CClass( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const char *name ) 151 : namespaceScopes( namespaceScopes ) 152 , importedNamespaces( importedNamespaces ) 153 , ConstructorMemberSubIndex( 0 ) 154 , DestructorMemberSubIndex( 0 ) 155 , classType( Class ) 156 , isUsing( false ) 157 , pobj_InheritsClass( NULL ) 158 , ppobj_Member( NULL ) 159 , iMemberNum( 0 ) 160 , vtbl_num( 0 ) 161 , iAlign( 0 ) 162 , vtbl_offset( -1 ) 163 , isCompilingConstructor( false ) 164 , isCompilingDestructor( false ) 165 , pobj_NextClass( NULL ) 165 166 { 166 167 this->name=(char *)HeapAlloc(hHeap,0,lstrlen(name)+1); … … 854 855 } 855 856 856 CClass *CDBClass::AddClass( const NamespaceScopes &namespaceScopes, const char *name,int nowLine){857 CClass *CDBClass::AddClass( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const char *name,int nowLine){ 857 858 ////////////////////////////////////////////////////////////////////////// 858 859 // クラスを追加 … … 861 862 862 863 CClass *pobj_c; 863 pobj_c=new CClass(namespaceScopes, name);864 pobj_c=new CClass(namespaceScopes, importedNamespaces, name); 864 865 865 866 if(lstrcmp(name,"String")==0){ … … 910 911 namespaceScopes.clear(); 911 912 913 // Importsされた名前空間の管理 914 NamespaceScopesCollection &importedNamespaces = Smoothie::Meta::importedNamespaces; 915 importedNamespaces.clear(); 916 912 917 for(i=0;;i++){ 913 918 if(basbuf[i]=='\0') break; … … 934 939 935 940 i += 2; 941 continue; 942 } 943 else if( basbuf[i] == 1 && basbuf[i+1] == ESC_IMPORTS ){ 944 for(i+=2,i2=0;;i2++,i++){ 945 if( IsCommandDelimitation( basbuf[i] ) ){ 946 temporary[i2]=0; 947 break; 948 } 949 temporary[i2]=basbuf[i]; 950 } 951 importedNamespaces.Imports( temporary ); 952 953 continue; 954 } 955 else if( basbuf[i] == 1 && basbuf[i+1] == ESC_CLEARNAMESPACEIMPORTED ){ 956 importedNamespaces.clear(); 936 957 continue; 937 958 } … … 971 992 972 993 //クラスを追加 973 CClass *pClass = pobj_DBClass->AddClass(namespaceScopes, temporary,nowLine);994 CClass *pClass = pobj_DBClass->AddClass(namespaceScopes, importedNamespaces, temporary,nowLine); 974 995 if( pClass ){ 975 996 if( basbuf[nowLine+1] == ESC_CLASS ){ … … 1010 1031 //関数ハッシュへ登録 1011 1032 GlobalProc *pUserProc; 1012 pUserProc=AddSubData( NamespaceScopes(), buffer,nowLine,bVirtual,pobj_c, (bStatic!=0) );1033 pUserProc=AddSubData( NamespaceScopes(), NamespaceScopesCollection(), buffer,nowLine,bVirtual,pobj_c, (bStatic!=0) ); 1013 1034 if(!pUserProc) return; 1014 1035 -
BasicCompiler_Common/Class.h
r102 r108 64 64 // 名前空間 65 65 NamespaceScopes namespaceScopes; 66 NamespaceScopesCollection importedNamespaces; 66 67 67 68 //静的メンバ情報 … … 107 108 108 109 public: 109 CClass( const NamespaceScopes &namespaceScopes, const char *name );110 CClass( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const char *name ); 110 111 ~CClass(); 111 112 112 virtualconst NamespaceScopes &GetNamespaceScopes() const113 const NamespaceScopes &GetNamespaceScopes() const 113 114 { 114 115 return namespaceScopes; 116 } 117 const NamespaceScopesCollection &GetImportedNamespaces() const 118 { 119 return importedNamespaces; 115 120 } 116 121 … … 250 255 CClass *Find( const NamespaceScopes &namespaceScopes, const string &name ) const; 251 256 252 CClass *AddClass( const NamespaceScopes &namespaceScopes, const char *name,int nowLine);257 CClass *AddClass( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const char *name,int nowLine); 253 258 254 259 void ActionVtblSchedule(LONG_PTR ImageBase, LONG_PTR MemPos_CodeSection); -
BasicCompiler_Common/DebugMiddleFile.cpp
r102 r108 487 487 //クラス名 488 488 // TODO: 名前空間が未完成 489 pobj_DBClass->AddClass(NamespaceScopes(), buffer+i2,0);489 pobj_DBClass->AddClass(NamespaceScopes(),NamespaceScopesCollection(),buffer+i2,0); 490 490 i2+=lstrlen(buffer+i2)+1; 491 491 } … … 598 598 // オブジェクトを生成 599 599 // TODO: 名前空間が未完成 600 pUserProc = new GlobalProc( NamespaceScopes(), name, Procedure::Function, false, false, false );600 pUserProc = new GlobalProc( NamespaceScopes(), NamespaceScopesCollection(), name, Procedure::Function, false, false, false ); 601 601 pUserProc->pNextData=0; 602 602 pUserProc->id=id; -
BasicCompiler_Common/Procedure.cpp
r102 r108 377 377 return pParentClass->GetNamespaceScopes(); 378 378 } 379 const NamespaceScopesCollection &UserProc::GetImportedNamespaces() const 380 { 381 if( !pParentClass ){ 382 SetError(); 383 } 384 return pParentClass->GetImportedNamespaces(); 385 } 379 386 bool UserProc::IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const 380 387 { … … 383 390 } 384 391 392 /* 385 393 GlobalProc *GlobalProc::Create( const NamespaceScopes &namespaceScopes, char *buffer,int nowLine ){ 386 394 int i2; … … 509 517 510 518 return true; 511 } 519 }*/ 512 520 bool GlobalProc::IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const 513 521 { -
BasicCompiler_Common/Procedure.h
r101 r108 222 222 223 223 virtual const NamespaceScopes &GetNamespaceScopes() const; 224 virtual const NamespaceScopesCollection &GetImportedNamespaces() const; 224 225 virtual bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const; 225 226 … … 257 258 { 258 259 const NamespaceScopes namespaceScopes; 260 const NamespaceScopesCollection importedNamespaces; 259 261 public: 260 262 // ハッシュリスト用 261 263 GlobalProc *pNextData; 262 264 263 GlobalProc( const NamespaceScopes &namespaceScopes, const string &name, Kind kind, bool isMacro, bool isCdecl, bool isExport ):265 GlobalProc( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const string &name, Kind kind, bool isMacro, bool isCdecl, bool isExport ): 264 266 UserProc( name, kind, isMacro, isCdecl, isExport ), 265 267 namespaceScopes( namespaceScopes ), 268 importedNamespaces( importedNamespaces ), 266 269 pNextData( NULL ) 267 270 {} 268 271 ~GlobalProc(){} 269 272 /* 270 273 GlobalProc *Create( const NamespaceScopes &namespaceScopes, char *buffer,int nowLine ); 271 274 bool AddGlobalProc( const NamespaceScopes &namespaceScopes, char *buffer,int nowLine ); 272 275 */ 273 276 virtual const NamespaceScopes &GetNamespaceScopes() const 274 277 { 275 278 return namespaceScopes; 279 } 280 virtual const NamespaceScopesCollection &GetImportedNamespaces() const 281 { 282 return importedNamespaces; 276 283 } 277 284 -
BasicCompiler_Common/Subroutine.cpp
r101 r108 463 463 } 464 464 465 GlobalProc *AddSubData( const NamespaceScopes &namespaceScopes, c har *buffer,int nowLine,BOOL bVirtual,CClass *pobj_c, bool isStatic){465 GlobalProc *AddSubData( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, char *buffer,int nowLine,BOOL bVirtual,CClass *pobj_c, bool isStatic){ 466 466 int i2,i3; 467 467 char temporary[8192]; … … 584 584 SubNum++; 585 585 586 GlobalProc *pUserProc = new GlobalProc( namespaceScopes, temporary, kind, isMacro, isCdecl, isExport );586 GlobalProc *pUserProc = new GlobalProc( namespaceScopes, importedNamespaces, temporary, kind, isMacro, isCdecl, isExport ); 587 587 pUserProc->SetParentClass( pobj_c ); 588 588 … … 664 664 namespaceScopes.clear(); 665 665 666 // Importsされた名前空間の管理 667 NamespaceScopesCollection &importedNamespaces = Smoothie::Meta::importedNamespaces; 668 importedNamespaces.clear(); 669 666 670 i=-1; 667 671 while(1){ … … 707 711 continue; 708 712 } 713 else if( basbuf[i] == 1 && basbuf[i+1] == ESC_IMPORTS ){ 714 for(i+=2,i2=0;;i2++,i++){ 715 if( IsCommandDelimitation( basbuf[i] ) ){ 716 temporary[i2]=0; 717 break; 718 } 719 temporary[i2]=basbuf[i]; 720 } 721 importedNamespaces.Imports( temporary ); 722 723 continue; 724 } 725 else if( basbuf[i] == 1 && basbuf[i+1] == ESC_CLEARNAMESPACEIMPORTED ){ 726 importedNamespaces.clear(); 727 continue; 728 } 709 729 710 730 if(basbuf[i]==1&&basbuf[i+1]==ESC_DECLARE){ … … 722 742 } 723 743 if(basbuf[i]==1&&(basbuf[i+1]==ESC_SUB||basbuf[i+1]==ESC_FUNCTION||basbuf[i+1]==ESC_MACRO)){ 744 char statementChar = basbuf[i+1]; 745 724 746 for(i2=0;;i2++,i++){ 725 747 if(IsCommandDelimitation(basbuf[i])){ … … 730 752 if(basbuf[i]=='\0') break; 731 753 } 732 AddSubData(namespaceScopes,temporary,i,0,0); 733 754 AddSubData(namespaceScopes, importedNamespaces, temporary,i,0,0); 755 756 /* Sub ~ End Sub 757 Function ~ End Function 758 Macro ~ End Macro 759 を飛び越す */ 760 char endStatementChar = GetEndXXXCommand( statementChar ); 761 for(i2=0;;i++,i2++){ 762 if( basbuf[i] == '\0' ) break; 763 if( basbuf[i] == 1 && basbuf[i+1] == endStatementChar ){ 764 i++; 765 break; 766 } 767 } 768 if(basbuf[i]=='\0') break; 734 769 continue; 735 770 } … … 746 781 //////////// 747 782 namespaceScopes.clear(); 783 importedNamespaces.clear(); 748 784 749 785 sprintf(temporary,"%c%c_allrem()",1,ESC_SUB); 750 AddSubData( namespaceScopes, temporary,0,0,0);786 AddSubData( namespaceScopes, importedNamespaces, temporary,0,0,0); 751 787 752 788 sprintf(temporary,"%c%c_aullrem()",1,ESC_SUB); 753 AddSubData( namespaceScopes, temporary,0,0,0);789 AddSubData( namespaceScopes, importedNamespaces, temporary,0,0,0); 754 790 755 791 sprintf(temporary,"%c%c_allmul()",1,ESC_SUB); 756 AddSubData( namespaceScopes, temporary,0,0,0);792 AddSubData( namespaceScopes, importedNamespaces, temporary,0,0,0); 757 793 758 794 sprintf(temporary,"%c%c_alldiv()",1,ESC_SUB); 759 AddSubData( namespaceScopes, temporary,0,0,0);795 AddSubData( namespaceScopes, importedNamespaces, temporary,0,0,0); 760 796 761 797 sprintf(temporary,"%c%c_aulldiv()",1,ESC_SUB); 762 AddSubData( namespaceScopes, temporary,0,0,0);798 AddSubData( namespaceScopes, importedNamespaces, temporary,0,0,0); 763 799 764 800 sprintf(temporary,"%c%c_allshl()",1,ESC_SUB); 765 AddSubData( namespaceScopes, temporary,0,0,0);801 AddSubData( namespaceScopes, importedNamespaces, temporary,0,0,0); 766 802 767 803 sprintf(temporary,"%c%c_allshr()",1,ESC_SUB); 768 AddSubData( namespaceScopes, temporary,0,0,0);804 AddSubData( namespaceScopes, importedNamespaces, temporary,0,0,0); 769 805 770 806 sprintf(temporary,"%c%c_aullshr()",1,ESC_SUB); 771 AddSubData( namespaceScopes, temporary,0,0,0);807 AddSubData( namespaceScopes, importedNamespaces, temporary,0,0,0); 772 808 773 809 sprintf(temporary,"%c%c_System_InitStaticLocalVariables()",1,ESC_SUB); 774 AddSubData( namespaceScopes, temporary,0,0,0);810 AddSubData( namespaceScopes, importedNamespaces, temporary,0,0,0); 775 811 } 776 812 void Delete_si(GlobalProc *pUserProc){ -
BasicCompiler_Common/common.h
r107 r108 450 450 bool GetReturnTypeOfPropertyMethod( const char *variable, const char *rightSide, Type &resultType ); 451 451 bool GetReturnTypeOfIndexerGetterProc( const CClass &objClass, Type &resultType ); 452 GlobalProc *AddSubData( const NamespaceScopes &namespaceScopes, c har *buffer,int nowLine,BOOL bVirtual,CClass *pobj_c, bool isStatic = false );452 GlobalProc *AddSubData( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, char *buffer,int nowLine,BOOL bVirtual,CClass *pobj_c, bool isStatic = false ); 453 453 void GetSubInfo(void); 454 454 void DeleteSubInfo(GlobalProc **ppSubHash,char **ppMacroNames,int MacroNum);
Note:
See TracChangeset
for help on using the changeset viewer.