Ignore:
Timestamp:
May 5, 2008, 1:09:21 PM (17 years ago)
Author:
dai_9181
Message:

AddMemberAddDynamicMethod
・CMember→Member
・CreateMemberメソッドをCClassクラスからLexicalAnalyzerクラスへ移動した。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Class.cpp

    r560 r561  
    185185}
    186186
    187 CMember *CClass::CreateMember( Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer, int nowLine )
    188 {
    189     extern int cp;
    190 
    191     //構文を解析
    192     char VarName[VN_SIZE];
    193     char initBuffer[VN_SIZE];
    194     char lpszConstructParameter[VN_SIZE];
    195     Subscripts subscripts;
    196     Type type;
    197     GetDimentionFormat(buffer,VarName,subscripts,type,initBuffer,lpszConstructParameter);
    198 
    199     //重複チェック
    200     if(this->DupliCheckAll(VarName)){
    201         compiler.errorMessenger.Output(15,VarName,cp);
    202     }
    203 
    204     CMember *pMember = new CMember( accessibility, VarName, type, isConst, subscripts, initBuffer, lpszConstructParameter );
    205     pMember->source_code_address = nowLine;
    206     return pMember;
    207 }
    208 void CClass::AddMember( Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer, int nowLine ){
    209     dynamicMembers.push_back(
    210         CreateMember( accessibility, isConst, isRef, buffer, nowLine )
    211     );
    212 }
    213 void CClass::AddStaticMember( Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer, int nowLine ){
    214     staticMembers.push_back(
    215         CreateMember( accessibility, isConst, isRef, buffer, nowLine )
    216     );
     187void CClass::AddDynamicMember( Member *pMember )
     188{
     189    dynamicMembers.push_back( pMember );
     190}
     191void CClass::AddStaticMember( Member *pMember )
     192{
     193    staticMembers.push_back( pMember );
    217194}
    218195
     
    247224
    248225    // 動的メンバ
    249     BOOST_FOREACH( CMember *pMember, dynamicMembers )
     226    BOOST_FOREACH( Member *pMember, dynamicMembers )
    250227    {
    251228        if( GetName() == pMember->GetName() )
     
    256233
    257234    // 静的メンバ
    258     BOOST_FOREACH( CMember *pMember, staticMembers ){
     235    BOOST_FOREACH( Member *pMember, staticMembers ){
    259236        if( GetName() == pMember->GetName() ){
    260237            return true;
     
    265242}
    266243
    267 const CMember *CClass::FindDynamicMember( const char *memberName ) const
     244const Member *CClass::FindDynamicMember( const char *memberName ) const
    268245{
    269246    if( this->HasSuperClass() )
    270247    {
    271248        // 基底クラスで検索
    272         const CMember *result = this->GetSuperClass().FindDynamicMember( memberName );
     249        const Member *result = this->GetSuperClass().FindDynamicMember( memberName );
    273250        if( result )
    274251        {
     
    277254    }
    278255
    279     BOOST_FOREACH( CMember *pMember, GetDynamicMembers() )
     256    BOOST_FOREACH( Member *pMember, GetDynamicMembers() )
    280257    {
    281258        if( pMember->GetName() == memberName )
     
    373350    }
    374351
    375     BOOST_FOREACH( CMember *pMember, dynamicMembers )
     352    BOOST_FOREACH( Member *pMember, dynamicMembers )
    376353    {
    377354        // メンバサイズ
     
    479456    }
    480457
    481     BOOST_FOREACH( CMember *pMember, dynamicMembers )
     458    BOOST_FOREACH( Member *pMember, dynamicMembers )
    482459    {
    483460        // メンバサイズ
     
    580557    }
    581558
    582     BOOST_FOREACH( CMember *pMember, dynamicMembers )
     559    BOOST_FOREACH( Member *pMember, dynamicMembers )
    583560    {
    584561        int tempAlignment = pMember->GetType().GetSize();
     
    761738
    762739        int i=0;
    763         BOOST_FOREACH( CMember *member, objClass.GetStaticMembers() )
     740        BOOST_FOREACH( Member *member, objClass.GetStaticMembers() )
    764741        {
    765742            if( pEnumInfo )
     
    1017994    std::string result;
    1018995
    1019     BOOST_FOREACH( const CMember *pMember, dynamicMembers )
     996    BOOST_FOREACH( const Member *pMember, dynamicMembers )
    1020997    {
    1021998        if( result.size() )
     
    10331010    std::string result;
    10341011
    1035     BOOST_FOREACH( const CMember *pMember, dynamicMembers )
     1012    BOOST_FOREACH( const Member *pMember, dynamicMembers )
    10361013    {
    10371014        if( result.size() )
     
    10491026    std::string result;
    10501027
    1051     BOOST_FOREACH( const CMember *pMember, dynamicMembers )
     1028    BOOST_FOREACH( const Member *pMember, dynamicMembers )
    10521029    {
    10531030        if( result.size() )
     
    10701047{
    10711048    const CClass &thisClass = *this;
    1072     BOOST_FOREACH( const CMember *pMember, thisClass.GetDynamicMembers() )
     1049    BOOST_FOREACH( const Member *pMember, thisClass.GetDynamicMembers() )
    10731050    {
    10741051        if( pMember->GetType().IsObject() || pMember->GetType().IsPointer() )
Note: See TracChangeset for help on using the changeset viewer.