Ignore:
Timestamp:
Mar 24, 2008, 8:05:20 PM (16 years ago)
Author:
dai_9181
Message:

Messenger/ErrorMessengerクラスを導入。SetError関数によるエラー生成を廃止した。

File:
1 edited

Legend:

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

    r461 r465  
    105105    //パラメータ
    106106    if(sourceOfParams[i]!='('){
    107         SetError(1,NULL,nowLine);
     107        compiler.errorMessenger.Output(1,NULL,nowLine);
    108108        return false;
    109109    }
     
    111111        //クラスのメンバ関数の場合のみ、デストラクタにパラメータがある場合にエラーをだす
    112112        if(this->GetName()[0]=='~'){
    113             SetError(114,NULL,nowLine);
     113            compiler.errorMessenger.Output(114,NULL,nowLine);
    114114            return false;
    115115        }
     
    133133            if( !this->IsFunction() ){
    134134                // Sub/Macroの場合
    135                 SetError(38,this->GetName(),nowLine);
     135                compiler.errorMessenger.Output(38,this->GetName(),nowLine);
    136136            }
    137137
     
    140140        else
    141141        {
    142             SetError(1,NULL,nowLine);
     142            compiler.errorMessenger.Output(1,NULL,nowLine);
    143143            return false;
    144144        }
     
    199199            if( isRef == false )
    200200            {
    201                 SetError(29,NULL,nowLine);
     201                compiler.errorMessenger.Output(29,NULL,nowLine);
    202202            }
    203203            isArray = true;
     
    248248
    249249            if( type.IsNull() ){
    250                 SetError(3,temporary,nowLine);
     250                compiler.errorMessenger.Output(3,temporary,nowLine);
    251251                type.SetBasicType( DEF_PTR_VOID );
    252252            }
     
    261261        else{
    262262            type.SetBasicType( Type::GetBasicTypeFromSimpleName(name) );
    263             SetError(-103,name,nowLine);
     263            compiler.errorMessenger.Output(-103,name,nowLine);
    264264        }
    265265
     
    325325        if(sw){
    326326            //配列パラメータ
    327             if( isRef == false ) SetError(29,NULL,nowLine);
     327            if( isRef == false ) compiler.errorMessenger.Output(29,NULL,nowLine);
    328328            isArray = true;
    329329
     
    389389
    390390            if( type.IsNull() ){
    391                 SetError(3,temporary,nowLine);
     391                compiler.errorMessenger.Output(3,temporary,nowLine);
    392392                type.SetBasicType( DEF_PTR_VOID );
    393393            }
     
    402402        else{
    403403            type.SetBasicType( Type::GetBasicTypeFromSimpleName(temporary) );
    404             SetError(-103,temporary,nowLine);
     404            compiler.errorMessenger.Output(-103,temporary,nowLine);
    405405        }
    406406
     
    421421        if( !this->IsFunction() ){
    422422            // Sub/Macroの場合
    423             SetError(38,this->GetName(),nowLine);
     423            compiler.errorMessenger.Output(38,this->GetName(),nowLine);
    424424        }
    425425
     
    428428                this->GetName()[0]=='~'){
    429429                //クラスのコンストラクタ、デストラクタがFunction定義の場合はエラーをだす
    430                 SetError(115,NULL,nowLine);
     430                compiler.errorMessenger.Output(115,NULL,nowLine);
    431431            }
    432432        }
     
    435435        if( this->returnType.IsNull() )
    436436        {
    437             SetError(3,returnTypeStr,nowLine);
     437            compiler.errorMessenger.Output(3,returnTypeStr,nowLine);
    438438        }
    439439    }
     
    442442        {
    443443            // Function定義なのに、戻り値の型がセットされていない
    444             SetError(-104,this->GetName().c_str(),nowLine);
     444            compiler.errorMessenger.Output(-104,this->GetName().c_str(),nowLine);
    445445
    446446            this->returnType.SetBasicType( DEF_DOUBLE );
     
    495495    {
    496496        // 重複しているため、失敗
    497         SetError(15,pUserProc->GetName().c_str(),nowLine);
     497        compiler.errorMessenger.Output(15,pUserProc->GetName().c_str(),nowLine);
    498498        return false;
    499499    }
     
    536536    if(buffer[i]==1&&buffer[i+1]==ESC_OPERATOR){
    537537        if(!pobj_c){
    538             SetError(126,NULL,nowLine);
     538            compiler.errorMessenger.Output(126,NULL,nowLine);
    539539            return 0;
    540540        }
     
    570570        }
    571571        if(!iCalcId){
    572             SetError(1,NULL,nowLine);
     572            compiler.errorMessenger.Output(1,NULL,nowLine);
    573573            return 0;
    574574        }
     
    608608                else
    609609                {
    610                     SetError();
     610                    compiler.errorMessenger.OutputFatalError();
    611611                    return NULL;
    612612                }
     
    615615                if( SplitMemberName( memberName, parentName, dummyMemberName, refKind ) )
    616616                {
    617                     SetError(69,temporary,nowLine);
     617                    compiler.errorMessenger.Output(69,temporary,nowLine);
    618618                    return NULL;
    619619                }
     
    621621            else
    622622            {
    623                 SetError(68,temporary,nowLine);
     623                compiler.errorMessenger.Output(68,temporary,nowLine);
    624624                return NULL;
    625625            }
     
    642642
    643643        if(GetDeclareHash(temporary)){
    644             SetError(15,temporary,nowLine);
     644            compiler.errorMessenger.Output(15,temporary,nowLine);
    645645            return 0;
    646646        }
     
    715715    //パラメータ
    716716    if(sourceOfParams[i]!='('){
    717         SetError(1,NULL,nowLine);
     717        compiler.errorMessenger.Output(1,NULL,nowLine);
    718718        return 0;
    719719    }
     
    765765        if(sw){
    766766            //配列パラメータ
    767             if( isRef == false ) SetError(29,NULL,nowLine);
     767            if( isRef == false ) compiler.errorMessenger.Output(29,NULL,nowLine);
    768768            isArray = true;
    769769
     
    811811
    812812            if( type.IsNull() ){
    813                 SetError(3,temporary,nowLine);
     813                compiler.errorMessenger.Output(3,temporary,nowLine);
    814814                type.SetBasicType( DEF_PTR_VOID );
    815815            }
     
    817817        else{
    818818            type.SetBasicType( Type::GetBasicTypeFromSimpleName(temporary) );
    819             SetError(-103,temporary,nowLine);
     819            compiler.errorMessenger.Output(-103,temporary,nowLine);
    820820        }
    821821
     
    834834        else if(sourceOfParams[i]==')') continue;
    835835        else{
    836             SetError(1,NULL,nowLine);
     836            compiler.errorMessenger.Output(1,NULL,nowLine);
    837837            break;
    838838        }
     
    863863                }
    864864                compiler.StringToType( temporary, this->returnType );
    865                 if( this->returnType.IsNull() ) SetError(3,temporary,nowLine);
     865                if( this->returnType.IsNull() ) compiler.errorMessenger.Output(3,temporary,nowLine);
    866866
    867867                sw_as=1;
     
    891891    }
    892892    else{
    893         SetError(1,NULL,nowLine);
     893        compiler.errorMessenger.Output(1,NULL,nowLine);
    894894        return;
    895895    }
     
    912912        }
    913913        if(buffer[i]=='\0'){
    914             SetError(1,NULL,nowLine);
     914            compiler.errorMessenger.Output(1,NULL,nowLine);
    915915            return;
    916916        }
     
    921921    //ユーザー定義関数との重複チェック
    922922    if(GetSubHash(procName)){
    923         SetError(15,procName,nowLine);
     923        compiler.errorMessenger.Output(15,procName,nowLine);
    924924        return;
    925925    }
     
    935935    }
    936936    if( resultType.GetBasicType() != typeOfPtrChar ){
    937         SetError(1,NULL,nowLine);
     937        compiler.errorMessenger.Output(1,NULL,nowLine);
    938938        return;
    939939    }
     
    943943        lstrcat(dllFileName,".DLL");
    944944        if(lstrlen(dllFileName)>=16){
    945             SetError(7,NULL,nowLine);
     945            compiler.errorMessenger.Output(7,NULL,nowLine);
    946946            return;
    947947        }
     
    956956        }
    957957        if( resultType.GetBasicType() != typeOfPtrChar ){
    958             SetError(1,NULL,nowLine);
     958            compiler.errorMessenger.Output(1,NULL,nowLine);
    959959            return;
    960960        }
     
    977977    BOOST_FOREACH( const Parameter *pParam, pDllProc->Params() ){
    978978        if( pParam->IsObject() ){
    979             SetError(25,pParam->GetVarName(),nowLine);
     979            compiler.errorMessenger.Output(25,pParam->GetVarName(),nowLine);
    980980        }
    981981        if( !pParam->IsRef() ){
    982982            if( pParam->IsStruct() ){
    983                 SetError(28,pParam->GetVarName(),nowLine);
     983                compiler.errorMessenger.Output(28,pParam->GetVarName(),nowLine);
    984984            }
    985985        }
     
    992992        if( pDllProc->ReturnType().IsObject() ){
    993993            // DLL関数ではオブジェクトを戻り値にできない
    994             SetError(40,pDllProc->GetName(),nowLine);
     994            compiler.errorMessenger.Output(40,pDllProc->GetName(),nowLine);
    995995        }
    996996    }
     
    10101010    //パラメータ
    10111011    if(sourceOfParams[i]!='('){
    1012         SetError(1,NULL,nowLine);
     1012        compiler.errorMessenger.Output(1,NULL,nowLine);
    10131013        return 0;
    10141014    }
     
    10591059        if(sw){
    10601060            //配列パラメータ
    1061             if( isRef == false ) SetError(29,NULL,nowLine);
     1061            if( isRef == false ) compiler.errorMessenger.Output(29,NULL,nowLine);
    10621062            isArray = true;
    10631063
     
    11041104
    11051105            if( type.IsNull() ){
    1106                 SetError(3,temporary,nowLine);
     1106                compiler.errorMessenger.Output(3,temporary,nowLine);
    11071107                type.SetBasicType( DEF_PTR_VOID );
    11081108            }
     
    11101110        else{
    11111111            type.SetBasicType( Type::GetBasicTypeFromSimpleName(temporary) );
    1112             SetError(-103,temporary,nowLine);
     1112            compiler.errorMessenger.Output(-103,temporary,nowLine);
    11131113        }
    11141114
     
    11271127        else if(sourceOfParams[i]==')') continue;
    11281128        else{
    1129             SetError(1,NULL,nowLine);
     1129            compiler.errorMessenger.Output(1,NULL,nowLine);
    11301130            break;
    11311131        }
     
    11561156                }
    11571157                compiler.StringToType( temporary, this->returnType );
    1158                 if( this->returnType.IsNull() ) SetError(3,temporary,nowLine);
     1158                if( this->returnType.IsNull() ) compiler.errorMessenger.Output(3,temporary,nowLine);
    11591159
    11601160                sw_as=1;
     
    11741174        if( this->ReturnType().IsNull() ){
    11751175            // 戻り値がない
    1176             SetError(26,this->GetName(),nowLine);
     1176            compiler.errorMessenger.Output(26,this->GetName(),nowLine);
    11771177        }
    11781178    }
     
    11801180        if( !this->ReturnType().IsNull() ){
    11811181            // Sub定義なのに、戻り値がある
    1182             SetError(38,this->GetName(),nowLine);
     1182            compiler.errorMessenger.Output(38,this->GetName(),nowLine);
    11831183        }
    11841184    }
Note: See TracChangeset for help on using the changeset viewer.