Ignore:
Timestamp:
May 5, 2008, 2:17:58 PM (16 years ago)
Author:
dai_9181
Message:

IsExistIsExistDuplicationKeyName
・キー名ではなく、インスタンスそのものの重複を発見するためのIsExistメソッドを実装。

File:
1 edited

Legend:

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

    r561 r564  
    121121
    122122            //クラスを追加
    123             CClass *pClass = classes.Add(namespaceScopes, importedNamespaces, temporary,nowLine);
    124             if( pClass ){
    125                 if( source[nowLine+1] == ESC_CLASS ){
    126                     if( isEnum )
    127                     {
    128                         pClass->SetClassType( CClass::Enum );
    129                     }
    130                     else if( isDelegate )
    131                     {
    132                         pClass->SetClassType( CClass::Delegate );
    133                     }
    134                     else{
    135                         pClass->SetClassType( CClass::Class );
    136                     }
    137                 }
    138                 else if( source[nowLine+1] == ESC_INTERFACE ){
    139                     pClass->SetClassType( CClass::Interface );
     123            CClass *pClass = new CClass( namespaceScopes, importedNamespaces, temporary );
     124            if( classes.IsExist( pClass ) )
     125            {
     126                // 既に存在している
     127                compiler.errorMessenger.Output(15,pClass->GetName(), nowLine);
     128
     129                delete pClass;
     130
     131                continue;
     132            }
     133
     134            classes.Put( pClass );
     135
     136            if( source[nowLine+1] == ESC_CLASS )
     137            {
     138                if( isEnum )
     139                {
     140                    pClass->SetClassType( CClass::Enum );
     141                }
     142                else if( isDelegate )
     143                {
     144                    pClass->SetClassType( CClass::Delegate );
    140145                }
    141146                else{
    142                     pClass->SetClassType( CClass::Structure );
    143                 }
     147                    pClass->SetClassType( CClass::Class );
     148                }
     149            }
     150            else if( source[nowLine+1] == ESC_INTERFACE )
     151            {
     152                pClass->SetClassType( CClass::Interface );
     153            }
     154            else
     155            {
     156                pClass->SetClassType( CClass::Structure );
    144157            }
    145158
Note: See TracChangeset for help on using the changeset viewer.