Changeset 17 in dev
- Timestamp:
- Dec 20, 2006, 2:51:56 AM (18 years ago)
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler32/Compile_ProcOp.cpp
r11 r17 442 442 // コンストラクタをコンパイルするとき 443 443 //////////////////////////////////// 444 445 //コンストラクタのコンパイル開始を通知 446 pobj_CompilingClass->NotifyStartConstructorCompile(); 444 447 445 448 //スーパークラスかどうかの識別 … … 577 580 ////////////////////////////////////////// 578 581 579 if(pobj_CompilingClass){ 582 if( pobj_CompilingClass ){ 583 584 if( pobj_CompilingClass->IsCompilingConstructor() ){ 585 // コンストラクタをコンパイルしていたとき 586 // コンストラクタのコンパイルが完了したことを通知 587 588 pobj_CompilingClass->NotifyFinishConstructorCompile(); 589 } 590 580 591 if(psi->name[0]=='~'){ 581 592 //////////////////////////////////// -
BasicCompiler32/Compile_Var.cpp
r11 r17 157 157 return 1; 158 158 } 159 BOOL GetMemberOffset(bool ErrorEnabled,CClass *pobj_c,char *member,int *pType,RELATIVE_VAR *pRelativeVar,LONG_PTR *plpNestIndex,BOOL bPrivateAccess){159 BOOL GetMemberOffset(bool isErrorEnabled, bool isWriteAccess, CClass *pobj_c, char *member, int *pType, RELATIVE_VAR *pRelativeVar, LONG_PTR *plpNestIndex, BOOL bPrivateAccess){ 160 160 int i,offset; 161 161 … … 175 175 offset=GetSizeOfClassMember(pobj_c,VarName,&i); 176 176 if(i==pobj_c->iMemberNum){ 177 if( ErrorEnabled) SetError(103,VarName,cp);177 if(isErrorEnabled) SetError(103,VarName,cp); 178 178 return 0; 179 179 } … … 183 183 //同一クラスオブジェクトの場合はプライベートアクセスを容認する 184 184 if(pobj_c->ppobj_Member[i]->dwAccess==ACCESS_NON){ 185 if( ErrorEnabled) SetError(107,VarName,cp);185 if(isErrorEnabled) SetError(107,VarName,cp); 186 186 return 0; 187 187 } … … 190 190 if((bPrivateAccess==0&&pobj_c->ppobj_Member[i]->dwAccess==ACCESS_PRIVATE)|| 191 191 pobj_c->ppobj_Member[i]->dwAccess==ACCESS_NON){ 192 if( ErrorEnabled) SetError(107,VarName,cp);192 if(isErrorEnabled) SetError(107,VarName,cp); 193 193 return 0; 194 194 } 195 195 else if(bPrivateAccess==0&&pobj_c->ppobj_Member[i]->dwAccess==ACCESS_PROTECTED){ 196 if( ErrorEnabled) SetError(108,VarName,cp);196 if(isErrorEnabled) SetError(108,VarName,cp); 197 197 return 0; 198 198 } 199 } 200 201 //Const定義の場合は書き込みアクセスを制限する 202 //※コンストラクタをコンパイル中の場合は例外的に許可する 203 if( pobj_c->ppobj_Member[i]->IsConst() && //定数メンバである 204 isWriteAccess && //書き込みアクセスを要求されている 205 pobj_c->IsCompilingConstructor() == false //コンストラクタ コンパイル中を除く 206 ){ 207 //Const定義の変数に書き込みアクセスをしようとした場合 208 SetError(61,VarName,cp); 199 209 } 200 210 … … 211 221 else{ 212 222 if(lpPtrOffset[0]){ 213 if( ErrorEnabled) SetError(16,member,cp);223 if(isErrorEnabled) SetError(16,member,cp); 214 224 return 0; 215 225 } … … 227 237 //配列オフセット 228 238 if(!GetArrayOffset(pobj_c->ppobj_Member[i]->SubScripts,array,*pType,pobj_c->ppobj_Member[i]->TypeInfo.u.lpIndex)) 229 if( ErrorEnabled) SetError(14,member,cp);239 if(isErrorEnabled) SetError(14,member,cp); 230 240 } 231 241 else if(pobj_c->ppobj_Member[i]->SubScripts[0]!=-1){ … … 238 248 if(*pType==DEF_OBJECT){ 239 249 if(RefType!=DEF_OBJECT){ 240 if( ErrorEnabled) SetError(104,member,cp);250 if(isErrorEnabled) SetError(104,member,cp); 241 251 return 0; 242 252 } … … 248 258 //pObj[n].member 249 259 if(RefType!=DEF_OBJECT){ 250 if( ErrorEnabled) SetError(104,member,cp);260 if(isErrorEnabled) SetError(104,member,cp); 251 261 return 0; 252 262 } … … 261 271 //pObj->member 262 272 if(RefType!=DEF_PTR_OBJECT){ 263 if( ErrorEnabled) SetError(104,member,cp);273 if(isErrorEnabled) SetError(104,member,cp); 264 274 return 0; 265 275 } … … 287 297 //ppObj[n]->member 288 298 if(RefType!=DEF_PTR_OBJECT){ 289 if( ErrorEnabled) SetError(104,member,cp);299 if(isErrorEnabled) SetError(104,member,cp); 290 300 return 0; 291 301 } … … 302 312 } 303 313 else{ 304 if( ErrorEnabled) SetError(104,member,cp);314 if(isErrorEnabled) SetError(104,member,cp); 305 315 return 0; 306 316 } 307 317 } 308 318 309 if(!GetMemberOffset(ErrorEnabled,pobj_c->ppobj_Member[i]->TypeInfo.u.pobj_Class, 319 if(!GetMemberOffset( 320 isErrorEnabled, 321 isWriteAccess, 322 pobj_c->ppobj_Member[i]->TypeInfo.u.pobj_Class, 310 323 NestMember, 311 324 pType, … … 344 357 } 345 358 346 BOOL GetVarOffset(bool ErrorEnabled,bool WriteAccess,char *NameBuffer,int *pType,RELATIVE_VAR *pRelativeVar,LONG_PTR *plpIndex,int *pss){359 BOOL GetVarOffset(bool isErrorEnabled, bool isWriteAccess, char *NameBuffer, int *pType, RELATIVE_VAR *pRelativeVar, LONG_PTR *plpIndex, int *pss){ 347 360 extern BOOL bCompilingGlobal; 348 361 int i,RefType; … … 441 454 442 455 pRelativeVar->dwKind=VAR_DIRECTMEM; 443 if(!GetMemberOffset(ErrorEnabled,pobj_CompilingClass,variable,pType,pRelativeVar,&lpIndex,1)) return 0; 456 if(!GetMemberOffset( 457 isErrorEnabled, 458 isWriteAccess, 459 pobj_CompilingClass, 460 variable, 461 pType, 462 pRelativeVar, 463 &lpIndex,1)) return 0; 444 464 if(plpIndex) *plpIndex=lpIndex; 445 465 return 1; … … 513 533 } 514 534 515 if( ErrorEnabled) SetError(3,variable,cp);535 if(isErrorEnabled) SetError(3,variable,cp); 516 536 pRelativeVar->dwKind=NON_VAR; 517 537 return 0; … … 547 567 ok: 548 568 549 if(bConst && WriteAccess){569 if(bConst && isWriteAccess){ 550 570 //Const定義の変数に書き込みアクセスをしようとした場合 551 571 SetError(61,VarName,cp); … … 581 601 return 0; 582 602 } 583 584 LONG_PTR lp2;585 if(!GetMemberOffset(ErrorEnabled,(CClass *)lpIndex,member,pType,pRelativeVar,&lp2,0)) return 0;586 if(plpIndex) *plpIndex=lp2;587 603 } 588 604 else if(*pType==DEF_PTR_OBJECT){ … … 597 613 SetRelativeOffset(pType,lpIndex,pRelativeVar,lpPtrOffset); 598 614 pRelativeVar->dwKind=VAR_DIRECTMEM; 599 600 LONG_PTR lp2;601 if(!GetMemberOffset(ErrorEnabled,(CClass *)lpIndex,member,pType,pRelativeVar,&lp2,0)) return 0;602 if(plpIndex) *plpIndex=lp2;603 615 } 604 616 else{ … … 616 628 OpBuffer[obp++]=(char)0x8B; 617 629 OpBuffer[obp++]=(char)0x08; 618 619 LONG_PTR lp2;620 if(!GetMemberOffset(ErrorEnabled,(CClass *)lpIndex,member,pType,pRelativeVar,&lp2,0)) return 0;621 if(plpIndex) *plpIndex=lp2;622 630 } 623 631 } … … 641 649 OpBuffer[obp++]=(char)0x8B; 642 650 OpBuffer[obp++]=(char)0x08; 643 644 LONG_PTR lp2;645 if(!GetMemberOffset(ErrorEnabled,(CClass *)lpIndex,member,pType,pRelativeVar,&lp2,0)) return 0;646 if(plpIndex) *plpIndex=lp2;647 651 } 648 652 else{ … … 657 661 return 0; 658 662 } 663 664 LONG_PTR lp2; 665 if(!GetMemberOffset( 666 isErrorEnabled, 667 isWriteAccess, 668 (CClass *)lpIndex, 669 member,pType,pRelativeVar,&lp2,0)) return 0; 670 if(plpIndex) *plpIndex=lp2; 671 659 672 return 1; 660 673 } -
BasicCompiler32/Opcode.h
r11 r17 172 172 void GetWithName(char *buffer); 173 173 void SetThisPtrToReg(int reg); 174 BOOL GetVarOffset(bool ErrorEnabled,boolWriteAccess,char *NameBuffer,int *pType,RELATIVE_VAR *pRelativeVar,LONG_PTR *plpIndex,int *pss=0);174 BOOL GetVarOffset(bool isErrorEnabled,bool isWriteAccess,char *NameBuffer,int *pType,RELATIVE_VAR *pRelativeVar,LONG_PTR *plpIndex,int *pss=0); 175 175 BOOL SetInitGlobalData(int offset,int type,LONG_PTR lpIndex,int *SubScripts,char *InitBuf); 176 176 #define DIMFLAG_INITDEBUGVAR 1 -
BasicCompiler64/Compile_ProcOp.cpp
r11 r17 497 497 // コンストラクタをコンパイルするとき 498 498 //////////////////////////////////// 499 500 //コンストラクタのコンパイル開始を通知 501 pobj_CompilingClass->NotifyStartConstructorCompile(); 499 502 500 503 //スーパークラスかどうかの識別 … … 626 629 ////////////////////////////////////////// 627 630 628 if(pobj_CompilingClass){ 631 if( pobj_CompilingClass ){ 632 633 if( pobj_CompilingClass->IsCompilingConstructor() ){ 634 // コンストラクタをコンパイルしていたとき 635 // コンストラクタのコンパイルが完了したことを通知 636 637 pobj_CompilingClass->NotifyFinishConstructorCompile(); 638 } 639 629 640 if(psi->name[0]=='~'){ 630 641 //////////////////////////////////// -
BasicCompiler64/Compile_Var.cpp
r11 r17 179 179 return 1; 180 180 } 181 BOOL GetMemberOffset(bool ErrorEnabled,CClass *pobj_c,char *member,int *pType,RELATIVE_VAR *pRelativeVar,LONG_PTR *plpNestIndex,BOOL bPrivateAccess){181 BOOL GetMemberOffset(bool isErrorEnabled, bool isWriteAccess, CClass *pobj_c, char *member, int *pType, RELATIVE_VAR *pRelativeVar, LONG_PTR *plpNestIndex, BOOL bPrivateAccess){ 182 182 int i,offset; 183 183 … … 202 202 offset=GetSizeOfClassMember(pobj_c,VarName,&i); 203 203 if(i==pobj_c->iMemberNum){ 204 if( ErrorEnabled) SetError(103,VarName,cp);204 if(isErrorEnabled) SetError(103,VarName,cp); 205 205 return 0; 206 206 } … … 211 211 //同一クラスオブジェクトの場合はプライベートアクセスを容認する 212 212 if(pobj_c->ppobj_Member[i]->dwAccess==ACCESS_NON){ 213 if( ErrorEnabled) SetError(107,VarName,cp);213 if(isErrorEnabled) SetError(107,VarName,cp); 214 214 return 0; 215 215 } … … 218 218 if((bPrivateAccess==0&&pobj_c->ppobj_Member[i]->dwAccess==ACCESS_PRIVATE)|| 219 219 pobj_c->ppobj_Member[i]->dwAccess==ACCESS_NON){ 220 if( ErrorEnabled) SetError(107,VarName,cp);220 if(isErrorEnabled) SetError(107,VarName,cp); 221 221 return 0; 222 222 } 223 223 else if(bPrivateAccess==0&&pobj_c->ppobj_Member[i]->dwAccess==ACCESS_PROTECTED){ 224 if( ErrorEnabled) SetError(108,VarName,cp);224 if(isErrorEnabled) SetError(108,VarName,cp); 225 225 return 0; 226 226 } 227 } 228 229 //Const定義の場合は書き込みアクセスを制限する 230 //※コンストラクタをコンパイル中の場合は例外的に許可する 231 if( pobj_c->ppobj_Member[i]->IsConst() && //定数メンバである 232 isWriteAccess && //書き込みアクセスを要求されている 233 pobj_c->IsCompilingConstructor() == false //コンストラクタ コンパイル中を除く 234 ){ 235 //Const定義の変数に書き込みアクセスをしようとした場合 236 SetError(61,VarName,cp); 227 237 } 228 238 … … 239 249 else{ 240 250 if(lpPtrOffset[0]){ 241 if( ErrorEnabled) SetError(16,member,cp);251 if(isErrorEnabled) SetError(16,member,cp); 242 252 return 0; 243 253 } … … 256 266 //配列オフセット 257 267 if(!GetArrayOffset(pobj_c->ppobj_Member[i]->SubScripts,array,*pType,pobj_c->ppobj_Member[i]->TypeInfo.u.lpIndex)){ 258 if( ErrorEnabled) SetError(14,member,cp);268 if(isErrorEnabled) SetError(14,member,cp); 259 269 } 260 270 } … … 268 278 if(*pType==DEF_OBJECT){ 269 279 if(RefType!=DEF_OBJECT){ 270 if( ErrorEnabled) SetError(104,member,cp);280 if(isErrorEnabled) SetError(104,member,cp); 271 281 return 0; 272 282 } … … 278 288 //pObj[n].member 279 289 if(RefType!=DEF_OBJECT){ 280 if( ErrorEnabled) SetError(104,member,cp);290 if(isErrorEnabled) SetError(104,member,cp); 281 291 return 0; 282 292 } … … 291 301 //pObj->member 292 302 if(RefType!=DEF_PTR_OBJECT){ 293 if( ErrorEnabled) SetError(104,member,cp);303 if(isErrorEnabled) SetError(104,member,cp); 294 304 return 0; 295 305 } … … 315 325 //ppObj[n]->member 316 326 if(RefType!=DEF_PTR_OBJECT){ 317 if( ErrorEnabled) SetError(104,member,cp);327 if(isErrorEnabled) SetError(104,member,cp); 318 328 return 0; 319 329 } … … 329 339 } 330 340 else{ 331 if( ErrorEnabled) SetError(104,member,cp);341 if(isErrorEnabled) SetError(104,member,cp); 332 342 return 0; 333 343 } 334 344 } 335 345 336 if(!GetMemberOffset(ErrorEnabled, 346 if(!GetMemberOffset( 347 isErrorEnabled, 348 isWriteAccess, 337 349 pobj_c->ppobj_Member[i]->TypeInfo.u.pobj_Class, 338 350 NestMember, … … 371 383 SetReg_WholeVariable(DEF_PTR_VOID,&RelativeVar,reg); 372 384 } 373 BOOL GetVarOffset(bool ErrorEnabled,boolWriteAccess,char *NameBuffer,int *pType,RELATIVE_VAR *pRelativeVar,LONG_PTR *plpIndex,int *pss){385 BOOL GetVarOffset(bool isErrorEnabled,bool isWriteAccess,char *NameBuffer,int *pType,RELATIVE_VAR *pRelativeVar,LONG_PTR *plpIndex,int *pss){ 374 386 extern BOOL bCompilingGlobal; 375 387 int i,RefType; … … 465 477 466 478 pRelativeVar->dwKind=VAR_DIRECTMEM; 467 if(!GetMemberOffset(ErrorEnabled,pobj_CompilingClass,variable,pType,pRelativeVar,&lpIndex,1)) return 0; 479 if(!GetMemberOffset( 480 isErrorEnabled, 481 isWriteAccess, 482 pobj_CompilingClass, 483 variable, 484 pType, 485 pRelativeVar, 486 &lpIndex,1)) return 0; 468 487 if(plpIndex) *plpIndex=lpIndex; 469 488 return 1; … … 536 555 } 537 556 538 if( ErrorEnabled) SetError(3,variable,cp);557 if(isErrorEnabled) SetError(3,variable,cp); 539 558 pRelativeVar->dwKind=NON_VAR; 540 559 return 0; … … 571 590 ok: 572 591 573 if(bConst && WriteAccess){592 if(bConst && isWriteAccess){ 574 593 //Const定義の変数に書き込みアクセスをしようとした場合 575 594 SetError(61,VarName,cp); … … 605 624 return 0; 606 625 } 607 608 LONG_PTR lp2;609 if(!GetMemberOffset(ErrorEnabled,(CClass *)lpIndex,member,pType,pRelativeVar,&lp2,0)) return 0;610 if(plpIndex) *plpIndex=lp2;611 626 } 612 627 else if(*pType==DEF_PTR_OBJECT){ … … 621 636 SetRelativeOffset(pType,lpIndex,pRelativeVar,lpPtrOffset); 622 637 pRelativeVar->dwKind=VAR_DIRECTMEM; 623 624 LONG_PTR lp2;625 if(!GetMemberOffset(ErrorEnabled,(CClass *)lpIndex,member,pType,pRelativeVar,&lp2,0)) return 0;626 if(plpIndex) *plpIndex=lp2;627 638 } 628 639 else{ … … 639 650 //mov r11,qword ptr[r12] 640 651 op_mov_RM(sizeof(_int64),REG_R11,REG_R12,0,MOD_BASE); 641 642 LONG_PTR lp2;643 if(!GetMemberOffset(ErrorEnabled,(CClass *)lpIndex,member,pType,pRelativeVar,&lp2,0)) return 0;644 if(plpIndex) *plpIndex=lp2;645 652 } 646 653 } … … 663 670 //mov r11,qword ptr[r12] 664 671 op_mov_RM(sizeof(_int64),REG_R11,REG_R12,0,MOD_BASE); 665 666 LONG_PTR lp2;667 if(!GetMemberOffset(ErrorEnabled,(CClass *)lpIndex,member,pType,pRelativeVar,&lp2,0)) return 0;668 if(plpIndex) *plpIndex=lp2;669 672 } 670 673 else{ … … 679 682 return 0; 680 683 } 684 685 LONG_PTR lp2; 686 if(!GetMemberOffset( 687 isErrorEnabled, 688 isWriteAccess, 689 (CClass *)lpIndex, 690 member,pType,pRelativeVar,&lp2,0)) return 0; 691 if(plpIndex) *plpIndex=lp2; 692 681 693 return 1; 682 694 } -
BasicCompiler64/Opcode.h
r15 r17 317 317 void GetWithName(char *buffer); 318 318 void SetThisPtrToReg(int reg); 319 BOOL GetVarOffset(bool ErrorEnabled,boolWriteAccess,char *NameBuffer,int *pType,RELATIVE_VAR *pRelativeVar,LONG_PTR *plpIndex,int *pss=0);319 BOOL GetVarOffset(bool isErrorEnabled,bool isWriteAccess,char *NameBuffer,int *pType,RELATIVE_VAR *pRelativeVar,LONG_PTR *plpIndex,int *pss=0); 320 320 BOOL SetInitGlobalData(int offset,int type,LONG_PTR lpIndex,int *SubScripts,char *InitBuf); 321 321 #define DIMFLAG_INITDEBUGVAR 1 -
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 -
BasicCompiler_Common/Class.h
r4 r17 19 19 20 20 class CMember{ 21 bool isConst; 21 22 public: 22 23 char *name; … … 32 33 33 34 34 CMember( CClass *pobj_c,DWORD access,char *buffer,int NowLine=-1);35 CMember( CMember *pobj);35 CMember( CClass *pobj_c, DWORD access, bool idConst, char *buffer, int NowLine=-1 ); 36 CMember( CMember *pobj ); 36 37 CMember(); 37 38 ~CMember(); 39 40 bool IsConst(); 38 41 39 42 … … 91 94 ~CClass(); 92 95 93 void AddMember( DWORD dwAccess,char *buffer);94 void AddStaticMember( DWORD dwAccess,char *buffer,int NowLine);96 void AddMember( DWORD dwAccess, bool idConst, char *buffer ); 97 void AddStaticMember( DWORD dwAccess, bool isConst, char *buffer, int NowLine ); 95 98 void AddMethod(SUBINFO *psi,DWORD dwAccess,BOOL bAbstract,BOOL bVirtual); 96 99 void AddStaticMethod(SUBINFO *psi,DWORD dwAccess); … … 112 115 //オペレータ関数の取得 113 116 SUBINFO **GetOperatorSubInfo(BYTE idCalc,int &num); 117 118 119 //コンストラクタをコンパイルしているかどうかのチェックフラグ 120 private: 121 bool isCompilingConstructor; 122 public: 123 void NotifyStartConstructorCompile(); 124 void NotifyFinishConstructorCompile(); 125 bool IsCompilingConstructor(); 114 126 115 127 -
BasicCompiler_Common/Compile.cpp
r16 r17 48 48 //With情報 49 49 WITHINFO WithInfo; 50 51 52 /////////////////////////////////////////////////// 53 // トークンを取得 54 /////////////////////////////////////////////////// 55 void GetIdentifierToken( char *token, const char *source, int &pos ){ 56 for( int i=0; ; i++, pos++ ){ 57 if( ! IsVariableChar( source[pos] ) ){ 58 token[i] = 0; 59 break; 60 } 61 token[i] = source[pos]; 62 } 63 } 50 64 51 65 -
BasicCompiler_Common/common.h
r16 r17 575 575 576 576 //Compile.cpp 577 void GetIdentifierToken( char *token, const char *source, int &pos ); 577 578 int JumpStatement(const char *source, int &pos); 578 579 void DebugVariable(void); -
BasicCompiler_Common/error.cpp
r11 r17 142 142 if(num==59) sprintf(msg,"マニフェスト ファイル \"%s\" の読み込みに失敗。",KeyWord); 143 143 if(num==60) lstrcpy(msg,"Staticステートメントはグローバル領域では使用できません。"); 144 if(num==61) sprintf(msg,"\"%s\" Const定義の変数には書き込めません。",KeyWord);144 if(num==61) sprintf(msg,"\"%s\" は定数です。書き込めません。",KeyWord); 145 145 146 146
Note:
See TracChangeset
for help on using the changeset viewer.