Changeset 17 in dev for BasicCompiler_Common/Class.cpp
- Timestamp:
- Dec 20, 2006, 2:51:56 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/Class.cpp
r5 r17 16 16 17 17 18 CMember::CMember( CClass *pobj_c,DWORD access,char *buffer,int NowLine){18 CMember::CMember( CClass *pobj_c, DWORD access, bool isConst, char *buffer, int NowLine ){ 19 19 extern int cp; 20 20 … … 46 46 dwAccess=access; 47 47 48 //定数扱いかどうか 49 this->isConst = isConst; 50 48 51 //初期データ 49 52 InitBuf=(char *)HeapAlloc(hHeap,0,lstrlen(init_buf)+1); … … 64 67 name=(char *)HeapAlloc(hHeap,0,lstrlen(pobj->name)+1); 65 68 lstrcpy(name,pobj->name); 69 70 //定数扱いかどうか 71 isConst = pobj->isConst; 66 72 67 73 //SubScripts … … 81 87 if(InitBuf) HeapDefaultFree(InitBuf); 82 88 if(ConstractParameter) HeapDefaultFree(ConstractParameter); 89 } 90 91 bool CMember::IsConst(){ 92 return isConst; 83 93 } 84 94 … … 159 169 this->name=(char *)HeapAlloc(hHeap,0,lstrlen(name)+1); 160 170 lstrcpy(this->name,name); 171 172 isCompilingConstructor = 0; 161 173 } 162 174 CClass::~CClass(){ … … 202 214 } 203 215 } 204 void CClass::AddMember( DWORD dwAccess,char *buffer){205 ppobj_Member =(CMember **)HeapReAlloc(hHeap,0,ppobj_Member,(iMemberNum+1)*sizeof(CMember *));206 ppobj_Member[iMemberNum] =new CMember(this,dwAccess,buffer);216 void CClass::AddMember( DWORD dwAccess, bool isConst, char *buffer ){ 217 ppobj_Member = (CMember **)HeapReAlloc( hHeap, 0, ppobj_Member, ( iMemberNum + 1 ) * sizeof(CMember *) ); 218 ppobj_Member[iMemberNum] = new CMember( this, dwAccess, isConst, buffer ); 207 219 iMemberNum++; 208 220 } 209 void CClass::AddStaticMember( DWORD dwAccess,char *buffer,int NowLine){221 void CClass::AddStaticMember( DWORD dwAccess, bool isConst, char *buffer, int NowLine ){ 210 222 ppobj_StaticMember=(CMember **)HeapReAlloc(hHeap,0,ppobj_StaticMember,(iStaticMemberNum+1)*sizeof(CMember *)); 211 ppobj_StaticMember[iStaticMemberNum]=new CMember( this,dwAccess,buffer,NowLine);223 ppobj_StaticMember[iStaticMemberNum]=new CMember( this, dwAccess, isConst, buffer, NowLine ); 212 224 iStaticMemberNum++; 213 225 } … … 380 392 381 393 return ppArray_si; 394 } 395 396 // コンストラクタのコンパイルを開始 397 void CClass::NotifyStartConstructorCompile(){ 398 isCompilingConstructor = true; 399 } 400 401 //コンストラクタのコンパイルを終了 402 void CClass::NotifyFinishConstructorCompile(){ 403 isCompilingConstructor = false; 404 } 405 406 //コンストラクタをコンパイル中かどうかを判別 407 bool CClass::IsCompilingConstructor(){ 408 return isCompilingConstructor; 382 409 } 383 410 … … 700 727 701 728 //インターフェイス名を取得 702 for(i2=0;;i++,i2++){ 703 if(IsCommandDelimitation(basbuf[i])){ 704 temporary[i2]=0; 705 break; 706 } 707 temporary[i2]=basbuf[i]; 708 } 729 GetIdentifierToken( temporary, basbuf, i ); 709 730 710 731 pobj_c=pobj_DBClass->check(temporary); … … 897 918 898 919 //クラス名を取得 899 for(i2=0;;i++,i2++){ 900 if(IsCommandDelimitation(basbuf[i])){ 901 temporary[i2]=0; 902 break; 903 } 904 temporary[i2]=basbuf[i]; 905 } 920 GetIdentifierToken( temporary, basbuf, i ); 906 921 907 922 pobj_c=pobj_DBClass->check(temporary); … … 1051 1066 else bStatic=0; 1052 1067 1068 //Const修飾子 1069 bool isConst = false; 1070 if( basbuf[i] == 1 && basbuf[i + 1] == ESC_CONST ){ 1071 isConst = true; 1072 i += 2; 1073 } 1074 1053 1075 if(basbuf[i]==1&&( 1054 1076 basbuf[i+1]==ESC_ABSTRACT||basbuf[i+1]==ESC_VIRTUAL||basbuf[i+1]==ESC_OVERRIDE|| … … 1128 1150 //静的メンバを追加 1129 1151 cp=i; //エラー用 1130 pobj_c->AddStaticMember( dwAccess,temporary,i);1152 pobj_c->AddStaticMember( dwAccess, isConst, temporary, i); 1131 1153 } 1132 1154 else{ 1133 1155 //メンバを追加 1134 1156 cp=i; //エラー用 1135 pobj_c->AddMember( dwAccess,temporary);1157 pobj_c->AddMember( dwAccess, isConst, temporary ); 1136 1158 1137 1159
Note:
See TracChangeset
for help on using the changeset viewer.