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