Changeset 108 in dev for BasicCompiler_Common/Subroutine.cpp
- Timestamp:
- May 6, 2007, 6:52:10 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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){
Note:
See TracChangeset
for help on using the changeset viewer.