Changeset 101 in dev for BasicCompiler_Common/Class.cpp
- Timestamp:
- Apr 25, 2007, 4:19:28 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/Class.cpp
r100 r101 144 144 145 145 146 CClass::CClass(const char *name): 146 CClass::CClass( const NamespaceScopes &namespaceScopes, const char *name ): 147 namespaceScopes( namespaceScopes ), 147 148 ConstructorMemberSubIndex( 0 ), 148 149 DestructorMemberSubIndex( 0 ), … … 193 194 } 194 195 196 bool CClass::IsEqualSymbol() const 197 { 198 return false; 199 } 200 195 201 bool CClass::IsUsing() const 196 202 { … … 803 809 } 804 810 805 CClass *CDBClass::AddClass( const char *name,int nowLine){811 CClass *CDBClass::AddClass( const NamespaceScopes &namespaceScopes, const char *name,int nowLine){ 806 812 ////////////////////////////////////////////////////////////////////////// 807 813 // クラスを追加 … … 810 816 811 817 CClass *pobj_c; 812 pobj_c=new CClass(name );818 pobj_c=new CClass(namespaceScopes, name); 813 819 814 820 if(lstrcmp(name,"String")==0){ … … 852 858 void CDBClass::InitNames(void){ 853 859 extern char *basbuf; 854 int i; 860 int i, i2; 861 char temporary[VN_SIZE]; 862 863 // 名前空間管理 864 NamespaceScopes &namespaceScopes = Smoothie::Lexical::liveingNamespaceScopes; 865 namespaceScopes.clear(); 855 866 856 867 for(i=0;;i++){ 857 868 if(basbuf[i]=='\0') break; 869 870 if( basbuf[i] == 1 && basbuf[i+1] == ESC_NAMESPACE ){ 871 for(i+=2,i2=0;;i2++,i++){ 872 if( IsCommandDelimitation( basbuf[i] ) ){ 873 temporary[i2]=0; 874 break; 875 } 876 temporary[i2]=basbuf[i]; 877 } 878 namespaceScopes.push_back( temporary ); 879 880 continue; 881 } 882 else if( basbuf[i] == 1 && basbuf[i+1] == ESC_ENDNAMESPACE ){ 883 if( namespaceScopes.size() <= 0 ){ 884 SetError(12, "End Namespace", i ); 885 } 886 else{ 887 namespaceScopes.pop_back(); 888 } 889 890 i += 2; 891 continue; 892 } 858 893 859 894 if(basbuf[i]==1&&( … … 891 926 892 927 //クラスを追加 893 CClass *pClass = pobj_DBClass->AddClass( temporary,nowLine);928 CClass *pClass = pobj_DBClass->AddClass(namespaceScopes, temporary,nowLine); 894 929 if( pClass ){ 895 930 if( basbuf[nowLine+1] == ESC_CLASS ){
Note:
See TracChangeset
for help on using the changeset viewer.