Changeset 140 in dev for BasicCompiler_Common/VariableOpe.cpp
- Timestamp:
- Jun 15, 2007, 4:00:25 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/VariableOpe.cpp
r138 r140 547 547 bool GetMemberType( const CClass &objClass, const char *lpszMember, Type &resultType, BOOL bPrivateAccess, bool isErrorEnabled){ 548 548 extern int cp; 549 int i;550 549 551 550 //クラス、配列の構成要素を解析する … … 558 557 if(!GetVarFormatString(VarName,array,lpPtrOffset,NestMember,refType)) return false; 559 558 560 for(i=0;i<objClass.iMemberNum;i++){ 561 if( objClass.ppobj_Member[i]->GetName() == VarName ){ 559 bool isFound = false; 560 CMember *pMember = NULL; 561 BOOST_FOREACH( pMember, objClass.GetDynamicMembers() ){ 562 if( pMember->GetName() == VarName ){ 563 isFound = true; 562 564 break; 563 565 } 564 566 } 565 if( i==objClass.iMemberNum){567 if( !isFound ){ 566 568 if(isErrorEnabled) SetError(103,VarName,cp); 567 569 return false; … … 571 573 if( &objClass == pobj_CompilingClass ){ 572 574 //同一クラスオブジェクトの場合はプライベートアクセスを容認する 573 if( objClass.ppobj_Member[i]->IsNoneAccess() ){575 if( pMember->IsNoneAccess() ){ 574 576 if(isErrorEnabled) SetError(107,VarName,cp); 575 577 return false; … … 577 579 } 578 580 else{ 579 if(( bPrivateAccess==0 && objClass.ppobj_Member[i]->IsPrivate() )||580 objClass.ppobj_Member[i]->IsNoneAccess() ){581 if(( bPrivateAccess==0 && pMember->IsPrivate() )|| 582 pMember->IsNoneAccess() ){ 581 583 if(isErrorEnabled) SetError(107,VarName,cp); 582 584 return false; 583 585 } 584 else if( bPrivateAccess==0 && objClass.ppobj_Member[i]->IsProtected() ){586 else if( bPrivateAccess==0 && pMember->IsProtected() ){ 585 587 if(isErrorEnabled) SetError(108,VarName,cp); 586 588 return false; … … 588 590 } 589 591 590 resultType = objClass.ppobj_Member[i]->GetType();592 resultType = pMember->GetType(); 591 593 592 594 //ポインタ変数の場合 593 595 if( resultType.IsPointer() ){ 594 if( objClass.ppobj_Member[i]->SubScripts[0]==-1){596 if(pMember->SubScripts[0]==-1){ 595 597 lstrcpy(lpPtrOffset,array); 596 598 array[0]=0; … … 607 609 //入れ子構造の場合 608 610 609 return GetMemberType( objClass.ppobj_Member[i]->GetType().GetClass(),611 return GetMemberType( pMember->GetType().GetClass(), 610 612 NestMember, 611 613 resultType, … … 614 616 } 615 617 616 if(array[0]==0&& objClass.ppobj_Member[i]->SubScripts[0]!=-1){618 if(array[0]==0&&pMember->SubScripts[0]!=-1){ 617 619 resultType.SetBasicType( resultType.GetBasicType() | FLAG_PTR ); 618 620 return true; … … 633 635 } 634 636 bool GetVarType( const char *nameBuffer, Type &resultType, bool isErrorEnabled){ 635 int i;636 637 char variable[VN_SIZE]; 637 638 … … 668 669 ///////////////// 669 670 670 pVar = UserProc::CompilingUserProc().localVars.BackSearch( VarName);671 pVar = UserProc::CompilingUserProc().localVars.BackSearch( Symbol( VarName ) ); 671 672 if( pVar ){ 672 673 goto ok; … … 693 694 //クラス内メンバを参照するとき(通常) 694 695 695 for(i=0;i<pobj_CompilingClass->iMemberNum;i++){ 696 if( pobj_CompilingClass->ppobj_Member[i]->GetName() == VarName ){ 696 bool isFound = false; 697 BOOST_FOREACH( CMember *pMember, pobj_CompilingClass->GetDynamicMembers() ){ 698 if( pMember->GetName() == VarName ){ 699 isFound = true; 697 700 break; 698 701 } 699 702 } 700 if( i==pobj_CompilingClass->iMemberNum) goto NonClassMember;703 if( !isFound ) goto NonClassMember; 701 704 } 702 705 … … 715 718 GetNowStaticVarFullName(VarName,temporary); 716 719 717 pVar = globalVars.Find( temporary);720 pVar = globalVars.Find( Symbol( temporary ) ); 718 721 if( pVar ){ 719 722 goto ok; … … 744 747 sprintf(temp2,"%s.%s",VarName,temporary); 745 748 746 pVar = globalVars.Find( temp2);749 pVar = globalVars.Find( Symbol( temp2 ) ); 747 750 if( pVar ){ 748 751 lstrcpy(member,tempMember); … … 757 760 sprintf(temp2,"%s.%s",pobj_CompilingClass->GetName().c_str(),VarName); 758 761 759 pVar = globalVars.Find( temp2);762 pVar = globalVars.Find( Symbol( temp2 ) ); 760 763 if( pVar ){ 761 764 goto ok; … … 768 771 //////////////////// 769 772 770 pVar = globalVars.BackSearch( VarName);773 pVar = globalVars.BackSearch( Symbol( VarName ) ); 771 774 if( pVar ){ 772 775 goto ok; … … 1041 1044 extern int AllGlobalVarSize; 1042 1045 1043 if( globalVars.DuplicateCheck( name) ){1046 if( globalVars.DuplicateCheck( Symbol( name ) ) ){ 1044 1047 //2重定義のエラー 1045 1048 SetError(15,name,cp);
Note:
See TracChangeset
for help on using the changeset viewer.