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/NumOpe_GetType.cpp

    r461 r465  
    6161    if(!type){
    6262        extern int cp;
    63         SetError(300,NULL,cp);
     63        compiler.errorMessenger.Output(300,NULL,cp);
    6464    }
    6565
     
    8686            if(IsRealNumberType(type[sp-2])||IsRealNumberType(type[sp-1])){
    8787                //いずれかの項が実数のとき
    88                 SetError(45,temporary,cp);
     88                compiler.errorMessenger.Output(45,temporary,cp);
    8989                return 0;
    9090            }
     
    9292            //As以外の演算子に型名が指定されていないかをチェック
    9393            if((type[sp-2]&FLAG_CAST)||(type[sp-1]&FLAG_CAST)){
    94                 SetError(48,temporary,cp);
     94                compiler.errorMessenger.Output(48,temporary,cp);
    9595                return 0;
    9696            }
     
    100100            if(IsRealNumberType(type[sp-1])){
    101101                //実数のとき
    102                 SetError(45,temporary,cp);
     102                compiler.errorMessenger.Output(45,temporary,cp);
    103103                return 0;
    104104            }
     
    106106            //As以外の演算子に型名が指定されていないかをチェック
    107107            if(type[sp-1]&FLAG_CAST){
    108                 SetError(48,temporary,cp);
     108                compiler.errorMessenger.Output(48,temporary,cp);
    109109                return 0;
    110110            }
     
    125125            //As以外の演算子に型名が指定されていないかをチェック
    126126            if((type[sp-2]&FLAG_CAST)||(type[sp-1]&FLAG_CAST)){
    127                 SetError(48,temporary,cp);
     127                compiler.errorMessenger.Output(48,temporary,cp);
    128128                return 0;
    129129            }
     
    143143            //As以外の演算子に型名が指定されていないかをチェック
    144144            if((type[sp-2]&FLAG_CAST)||(type[sp-1]&FLAG_CAST)){
    145                 SetError(48,temporary,cp);
     145                compiler.errorMessenger.Output(48,temporary,cp);
    146146                return 0;
    147147            }
     
    154154            if(IsRealNumberType(type[sp-2])||IsRealNumberType(type[sp-1])){
    155155                //いずれかの項が実数のとき
    156                 SetError(45,temporary,cp);
     156                compiler.errorMessenger.Output(45,temporary,cp);
    157157                return 0;
    158158            }
     
    160160            //As以外の演算子に型名が指定されていないかをチェック
    161161            if((type[sp-2]&FLAG_CAST)||(type[sp-1]&FLAG_CAST)){
    162                 SetError(48,temporary,cp);
     162                compiler.errorMessenger.Output(48,temporary,cp);
    163163                return 0;
    164164            }
     
    168168            if((type[sp-1]&FLAG_CAST)==0){
    169169                //型名が指定されていないときはエラー
    170                 SetError(47,NULL,cp);
     170                compiler.errorMessenger.Output(47,NULL,cp);
    171171                return 0;
    172172            }
     
    176176            if(type[sp-1]&FLAG_CAST){
    177177                //型名が指定されていないときはエラー
    178                 SetError(47,NULL,cp);
     178                compiler.errorMessenger.Output(47,NULL,cp);
    179179                return 0;
    180180            }
     
    184184            //As以外の演算子に型名が指定されていないかをチェック
    185185            if(type[sp-1]&FLAG_CAST){
    186                 SetError(48,temporary,cp);
     186                compiler.errorMessenger.Output(48,temporary,cp);
    187187                return 0;
    188188            }
     
    279279    if( !compiler.StringToType( TypeName, resultType ) )
    280280    {
    281         SetError(3,TypeName,cp);
     281        compiler.errorMessenger.Output(3,TypeName,cp);
    282282        return false;
    283283    }
     
    285285    if( !resultType.IsObject() )
    286286    {
    287         SetError(121,NULL,cp);
     287        compiler.errorMessenger.Output(121,NULL,cp);
    288288        return false;
    289289    }
     
    326326        {
    327327            if( !GetReturnTypeOfIndexerGetterProc( classType, resultType ) ){
    328                 SetError(1,NULL,cp);
     328                compiler.errorMessenger.Output(1,NULL,cp);
    329329                return false;
    330330            }
     
    509509            //閉じカッコ")"に続く文字がNULLでないとき
    510510            if(termFull[i2+1+i4+1]!='\0'){
    511                 SetError(42,NULL,cp);
     511                compiler.errorMessenger.Output(42,NULL,cp);
    512512            }
    513513
     
    541541
    542542                    //閉じカッコ")"に続く文字がNULLでないときはエラーにする
    543                     if(termFull[i2+1+i4+1]!='\0') SetError(42,NULL,cp);
     543                    if(termFull[i2+1+i4+1]!='\0') compiler.errorMessenger.Output(42,NULL,cp);
    544544
    545545                    //マクロ関数の場合
     
    571571        if( classType.IsObject() ){
    572572            if( !GetReturnTypeOfIndexerGetterProc( classType, resultType ) ){
    573                 SetError(1,NULL,cp);
     573                compiler.errorMessenger.Output(1,NULL,cp);
    574574                return false;
    575575            }
     
    649649
    650650    if(expression[0]=='\0'){
    651         SetError(1,NULL,cp);
     651        compiler.errorMessenger.Output(1,NULL,cp);
    652652        return false;
    653653    }
     
    765765                    }
    766766                    else{
    767                         SetError(3, term, cp );
     767                        compiler.errorMessenger.Output(3, term, cp );
    768768                        goto error;
    769769                    }
     
    861861                        }
    862862                        else{
    863                             SetError(1,NULL,0);
     863                            compiler.errorMessenger.Output(1,NULL,0);
    864864                            goto error;
    865865                        }
     
    876876
    877877                    if(GetSubHash(VarName,0)){
    878                         SetError();
     878                        compiler.errorMessenger.OutputFatalError();
    879879                        Type tempType;
    880880                        GetReturnTypeOfPropertyMethod(term,NULL,tempType);
     
    894894                    //該当する識別子が見当たらないときはエラー扱いにする
    895895                    bError=1;
    896                     SetError(3,term,cp);
     896                    compiler.errorMessenger.Output(3,term,cp);
    897897                    type_stack[sp]=DEF_DOUBLE;
    898898                }
     
    984984                if( PTR_LEVEL( type_stack[sp-1] ) <= 0 ){
    985985                    //ポインタ型ではないとき
    986                     SetError( 3, NULL, cp );
     986                    compiler.errorMessenger.Output( 3, NULL, cp );
    987987                    goto error;
    988988                }
     
    996996
    997997    if(sp!=1){
    998         SetError(1,NULL,cp);
     998        compiler.errorMessenger.Output(1,NULL,cp);
    999999        goto error;
    10001000    }
Note: See TracChangeset for help on using the changeset viewer.