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

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

Location:
trunk/ab5.0/abdev/BasicCompiler_Common/src
Files:
1 added
19 edited

Legend:

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

    r461 r465  
    199199        const CClass *pInheritsClass = compiler.GetObjectModule().meta.GetClasses().Find(className);
    200200        if( !pInheritsClass ){
    201             SetError(106,className,nowLine);
     201            compiler.errorMessenger.Output(106,className,nowLine);
    202202            return false;
    203203        }
     
    212212        }
    213213        else{
    214             SetError(135,pInheritsClass->GetFullName().c_str(),nowLine);
     214            compiler.errorMessenger.Output(135,pInheritsClass->GetFullName().c_str(),nowLine);
    215215            return false;
    216216        }
     
    236236    if( !compiler.GetObjectModule().meta.GetClasses().LoopRefCheck(inheritsClass) )
    237237    {
    238         SetError(123,inheritsClass.GetName(),nowLine);
     238        compiler.errorMessenger.Output(123,inheritsClass.GetName(),nowLine);
    239239        return false;
    240240    }
     
    296296    {
    297297        // インターフェイスではないとき
    298         SetError(138,interfaceClass.GetName().c_str(),nowLine );
     298        compiler.errorMessenger.Output(138,interfaceClass.GetName().c_str(),nowLine );
    299299        return false;
    300300    }
     
    379379        const CClass *pInterfaceClass = compiler.GetObjectModule().meta.GetClasses().Find( className );
    380380        if( !pInterfaceClass ){
    381             SetError(106,paramStr.c_str(),nowLine);
     381            compiler.errorMessenger.Output(106,paramStr.c_str(),nowLine);
    382382            continue;
    383383        }
     
    404404    //重複チェック
    405405    if(this->DupliCheckAll(VarName)){
    406         SetError(15,VarName,cp);
     406        compiler.errorMessenger.Output(15,VarName,cp);
    407407    }
    408408
     
    466466        //デストラクタの場合はその名前が正しいかチェックを行う
    467467        if(lstrcmp(temporary+1,pobj_c->GetName().c_str())!=0)
    468             SetError(117,NULL,nowLine);
     468            compiler.errorMessenger.Output(117,NULL,nowLine);
    469469        else
    470470            bDestructor=1;
     
    489489
    490490    if(pobj_c->DupliCheckMember(temporary)){
    491         SetError(15,temporary,nowLine);
     491        compiler.errorMessenger.Output(15,temporary,nowLine);
    492492        return;
    493493    }
     
    502502        {
    503503            //関数名、パラメータ、戻り値が合致したとき
    504             SetError(15,pUserProc->GetName().c_str(),nowLine);
     504            compiler.errorMessenger.Output(15,pUserProc->GetName().c_str(),nowLine);
    505505            return;
    506506        }
     
    549549    if( interfaceName[0] )
    550550    {
    551         SetError(139,interfaceName,nowLine);
     551        compiler.errorMessenger.Output(139,interfaceName,nowLine);
    552552    }
    553553
     
    557557
    558558    if( isOverride ){
    559         SetError(12,"Override",nowLine);
     559        compiler.errorMessenger.Output(12,"Override",nowLine);
    560560    }
    561561
     
    757757                if( !pMember->GetType().IsStruct() )
    758758                {
    759                     SetError();
     759                    compiler.errorMessenger.OutputFatalError();
    760760                }
    761761
     
    863863                if( !pMember->GetType().IsStruct() )
    864864                {
    865                     SetError();
     865                    compiler.errorMessenger.OutputFatalError();
    866866                }
    867867
     
    985985    }
    986986
    987     SetError();
     987    compiler.errorMessenger.OutputFatalError();
    988988    return;
    989989}
     
    10021002    }
    10031003
    1004     SetError();
     1004    compiler.errorMessenger.OutputFatalError();
    10051005    return 0;
    10061006}
     
    10141014    if( vtblMasterListOffset == -1 )
    10151015    {
    1016         SetError();
     1016        compiler.errorMessenger.OutputFatalError();
    10171017    }
    10181018
     
    10421042    if( vtblMasterList.size() )
    10431043    {
    1044         SetError();
     1044        compiler.errorMessenger.OutputFatalError();
    10451045    }
    10461046
     
    10621062            if( this->comVtblOffset )
    10631063            {
    1064                 SetError();
     1064                compiler.errorMessenger.OutputFatalError();
    10651065            }
    10661066            this->comVtblOffset = tempVtblOffset;
     
    11671167    if( !Put( pClass ) )
    11681168    {
    1169         SetError(15,pClass->GetName(), nowLine);
     1169        compiler.errorMessenger.Output(15,pClass->GetName(), nowLine);
    11701170        return false;
    11711171    }
     
    14651465            pCompilingMethod = pParentClass->GetStaticMethods().GetMethodPtr( pUserProc );
    14661466            if( !pCompilingMethod ){
    1467                 SetError();
     1467                compiler.errorMessenger.OutputFatalError();
    14681468            }
    14691469        }
     
    14821482        if( !pStringClass )
    14831483        {
    1484             SetError(400, "System.String", cp);
     1484            compiler.errorMessenger.Output(400, "System.String", cp);
    14851485            static CClass dummy;
    14861486            return &dummy;
     
    14981498        if( !pObjectClass )
    14991499        {
    1500             SetError(400, "System.Object", cp);
     1500            compiler.errorMessenger.Output(400, "System.Object", cp);
    15011501            static CClass dummy;
    15021502            return &dummy;
     
    15141514        if( !pInterfaceInfo )
    15151515        {
    1516             SetError(400, "ActiveBasic.Core.InterfaceInfo", cp);
     1516            compiler.errorMessenger.Output(400, "ActiveBasic.Core.InterfaceInfo", cp);
    15171517            static CClass dummy;
    15181518            return &dummy;
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Class_Collect.cpp

    r461 r465  
    102102        else if( source[i] == 1 && source[i+1] == ESC_ENDNAMESPACE ){
    103103            if( namespaceScopes.size() <= 0 ){
    104                 SetError(12, "End Namespace", i );
     104                compiler.errorMessenger.Output(12, "End Namespace", i );
    105105            }
    106106            else{
     
    121121            if( !compiler.GetNamespaceSupporter().ImportsNamespace( temporary ) )
    122122            {
    123                 SetError(64,temporary,i );
     123                compiler.errorMessenger.Output(64,temporary,i );
    124124            }
    125125
     
    228228            if(pobj_LoopRefCheck->check(pMember->GetType().GetClass())){
    229229                extern int cp;
    230                 SetError(124,pMember->GetType().GetClass().GetName(),cp);
     230                compiler.errorMessenger.Output(124,pMember->GetType().GetClass().GetName(),cp);
    231231                return false;
    232232            }
     
    283283        else if( basbuf[i] == 1 && basbuf[i+1] == ESC_ENDNAMESPACE ){
    284284            if( namespaceScopes.size() <= 0 ){
    285                 SetError(12, "End Namespace", i );
     285                compiler.errorMessenger.Output(12, "End Namespace", i );
    286286            }
    287287            else{
     
    303303            if( !compiler.GetNamespaceSupporter().ImportsNamespace( temporary ) )
    304304            {
    305                 SetError(64,temporary,i );
     305                compiler.errorMessenger.Output(64,temporary,i );
    306306            }
    307307
     
    358358                    if( !compiler.StringToType( typeParameterBaseClassNames[i2], baseType ) )
    359359                    {
    360                         SetError(106,typeParameterBaseClassNames[i2],i);
     360                        compiler.errorMessenger.Output(106,typeParameterBaseClassNames[i2],i);
    361361                    }
    362362                    else if( !baseType.IsObject() )
    363363                    {
    364                         SetError(106,typeParameterBaseClassNames[i2],i);
     364                        compiler.errorMessenger.Output(106,typeParameterBaseClassNames[i2],i);
    365365                    }
    366366                }
     
    394394
    395395                if(lstrcmpi(temporary,pobj_c->GetName().c_str())==0){
    396                     SetError(105,temporary,i);
     396                    compiler.errorMessenger.Output(105,temporary,i);
    397397                    goto Interface_InheritsError;
    398398                }
     
    402402                const CClass *pInheritsClass = classes.Find(temporary);
    403403                if( !pInheritsClass ){
    404                     SetError(106,temporary,i);
     404                    compiler.errorMessenger.Output(106,temporary,i);
    405405                    goto Interface_InheritsError;
    406406                }
     
    427427                //エラー
    428428                if(basbuf[i]==1&&(basbuf[i+1]==ESC_CLASS||basbuf[i+1]==ESC_TYPE||basbuf[i+1]==ESC_INTERFACE)){
    429                     SetError(22,"Interface",i);
     429                    compiler.errorMessenger.Output(22,"Interface",i);
    430430                    i--;
    431431                    break;
     
    433433
    434434                if(basbuf[i]==1&&basbuf[i+1]==ESC_INHERITS){
    435                     SetError(111,NULL,i);
     435                    compiler.errorMessenger.Output(111,NULL,i);
    436436                    break;
    437437                }
    438438                else if( basbuf[i] == 1 && basbuf[i+1] == ESC_IMPLEMENTS )
    439439                {
    440                     SetError(137, NULL, i );
     440                    compiler.errorMessenger.Output(137, NULL, i );
    441441                    break;
    442442                }
     
    454454                    if(basbuf[i]=='\0'){
    455455                        i--;
    456                         SetError(22,"Interface",top_pos);
     456                        compiler.errorMessenger.Output(22,"Interface",top_pos);
    457457                        break;
    458458                    }
     
    466466                    temporary[1]==ESC_SUB||temporary[1]==ESC_FUNCTION
    467467                    ))){
    468                     SetError(1,NULL,i);
     468                    compiler.errorMessenger.Output(1,NULL,i);
    469469                    break;
    470470                }
     
    505505                if( dwClassType != ESC_TYPE )
    506506                {
    507                     SetError(140,NULL,i);
     507                    compiler.errorMessenger.Output(140,NULL,i);
    508508                }
    509509
    510510                if(!(iAlign==1||iAlign==2||iAlign==4||iAlign==8||iAlign==16))
    511                     SetError(51,NULL,i);
     511                    compiler.errorMessenger.Output(51,NULL,i);
    512512            }
    513513            else if( memicmp( basbuf + i, "Blittable(", 10 ) == 0 ){
     
    518518                if( dwClassType != ESC_CLASS )
    519519                {
    520                     SetError(141,NULL,i);
     520                    compiler.errorMessenger.Output(141,NULL,i);
    521521                }
    522522            }
     
    568568                    if( !compiler.StringToType( typeParameterBaseClassNames[i2], baseType ) )
    569569                    {
    570                         SetError(106,typeParameterBaseClassNames[i2],i);
     570                        compiler.errorMessenger.Output(106,typeParameterBaseClassNames[i2],i);
    571571                    }
    572572                    else if( !baseType.IsObject() )
    573573                    {
    574                         SetError(106,typeParameterBaseClassNames[i2],i);
     574                        compiler.errorMessenger.Output(106,typeParameterBaseClassNames[i2],i);
    575575                    }
    576576                }
     
    616616
    617617                    if(lstrcmpi(temporary,pobj_c->GetName().c_str())==0){
    618                         SetError(105,temporary,i);
     618                        compiler.errorMessenger.Output(105,temporary,i);
    619619                        goto InheritsError;
    620620                    }
     
    644644                //エラー
    645645                if(basbuf[i]==1&&(basbuf[i+1]==ESC_CLASS||basbuf[i+1]==ESC_TYPE)){
    646                     SetError(22,"Class",i);
     646                    compiler.errorMessenger.Output(22,"Class",i);
    647647                    i--;
    648648                    break;
     
    650650
    651651                if(basbuf[i]==1&&basbuf[i+1]==ESC_INHERITS){
    652                     SetError(111,NULL,i);
     652                    compiler.errorMessenger.Output(111,NULL,i);
    653653                    break;
    654654                }
    655655                else if( basbuf[i] == 1 && basbuf[i+1] == ESC_IMPLEMENTS )
    656656                {
    657                     SetError(137, NULL, i );
     657                    compiler.errorMessenger.Output(137, NULL, i );
    658658                    break;
    659659                }
     
    718718
    719719                        if(dwClassType==ESC_CLASS)
    720                             SetError(22,"Class",top_pos);
     720                            compiler.errorMessenger.Output(22,"Class",top_pos);
    721721                        else
    722                             SetError(22,"Type",top_pos);
     722                            compiler.errorMessenger.Output(22,"Type",top_pos);
    723723
    724724                        i--;
     
    810810                            basbuf[i+1]==ESC_ENUM)){
    811811                            GetDefaultNameFromES(i3,temporary);
    812                             SetError(22,temporary,i);
     812                            compiler.errorMessenger.Output(22,temporary,i);
    813813                        }
    814814                        if(basbuf[i]==1&&basbuf[i+1]==GetEndXXXCommand((char)i3)){
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/CommonCodeGenerator.cpp

    r436 r465  
    2222    if( pertialSchedules.size() > 0 )
    2323    {
    24         SetError();
     24        compiler.errorMessenger.OutputFatalError();
    2525    }
    2626}
     
    4040                {
    4141                    // 範囲外
    42                     SetError();
     42                    compiler.errorMessenger.OutputFatalError();
    4343                }
    4444
     
    5555            else
    5656            {
    57                 SetError();
     57                compiler.errorMessenger.OutputFatalError();
    5858            }
    5959
     
    7272    if( isSuccessful == false )
    7373    {
    74         SetError();
     74        compiler.errorMessenger.OutputFatalError();
    7575    }
    7676}
     
    9494            else
    9595            {
    96                 SetError();
     96                compiler.errorMessenger.OutputFatalError();
    9797            }
    9898
     
    111111    if( isSuccessful == false )
    112112    {
    113         SetError();
     113        compiler.errorMessenger.OutputFatalError();
    114114    }
    115115}
     
    133133                {
    134134                    // 範囲外
    135                     SetError();
     135                    compiler.errorMessenger.OutputFatalError();
    136136                }
    137137
     
    144144            else
    145145            {
    146                 SetError();
     146                compiler.errorMessenger.OutputFatalError();
    147147            }
    148148
     
    160160    if( isSuccessful == false )
    161161    {
    162         SetError();
     162        compiler.errorMessenger.OutputFatalError();
    163163    }
    164164}
     
    180180        else
    181181        {
    182             SetError();
     182            compiler.errorMessenger.OutputFatalError();
    183183        }
    184184    }
     
    196196        else
    197197        {
    198             SetError();
     198            compiler.errorMessenger.OutputFatalError();
    199199        }
    200200    }
     
    223223    else
    224224    {
    225         SetError();
     225        compiler.errorMessenger.OutputFatalError();
    226226    }
    227227
     
    276276    if( GetContinueCodePos() == -1 )
    277277    {
    278         SetError(12,"Continue",cp);
     278        compiler.errorMessenger.Output(12,"Continue",cp);
    279279        return;
    280280    }
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Compiler.cpp

    r461 r465  
    206206    }
    207207
    208     SetError(1, NULL, cp);
     208    compiler.errorMessenger.Output(1, NULL, cp);
    209209
    210210    return (string)"(null)";
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Const.cpp

    r265 r465  
    1717    for(i=0;;i++){
    1818        if(buffer[i]=='\0'){
    19             SetError(10,"Const",cp);
     19            compiler.errorMessenger.Output(10,"Const",cp);
    2020            return;
    2121        }
     
    3131        || compiler.GetObjectModule().meta.GetGlobalConsts().IsExist( name ) )
    3232    {
    33         SetError(15,name,cp);
     33        compiler.errorMessenger.Output(15,name,cp);
    3434        return;
    3535    }
     
    144144        extern int cp;
    145145        for(i2=0;i2<num;i2++) HeapDefaultFree(pParms[i2]);
    146         SetError(10,GetName().c_str(),cp);
     146        compiler.errorMessenger.Output(10,GetName().c_str(),cp);
    147147        lstrcpy(dest,"0");
    148148        return 1;
     
    206206    if(parameterStr[i]!='(')
    207207    {
    208         SetError();
     208        compiler.errorMessenger.OutputFatalError();
    209209        return;
    210210    }
     
    214214    for(i++,i2=0;;i++,i2++){
    215215        if(parameterStr[i]=='\0'){
    216             SetError(1,NULL,cp);
     216            compiler.errorMessenger.Output(1,NULL,cp);
    217217            return;
    218218        }
     
    226226                if(parameterStr[i]!='='){
    227227                    extern int cp;
    228                     SetError(1,NULL,cp);
     228                    compiler.errorMessenger.Output(1,NULL,cp);
    229229                    return;
    230230                }
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/DataTable.cpp

    r461 r465  
    121121            {
    122122                // エラー
    123                 SetError();
     123                compiler.errorMessenger.OutputFatalError();
    124124                return false;
    125125            }
     
    196196            i+=i2;
    197197            if(expression[i]!='\0'){
    198                 SetError(42,NULL,cp);
     198                compiler.errorMessenger.Output(42,NULL,cp);
    199199                return false;
    200200            }
     
    213213
    214214    if( !compiler.StringToType( typeName, resultType ) ){
    215         SetError(3,typeName,cp);
     215        compiler.errorMessenger.Output(3,typeName,cp);
    216216        return false;
    217217    }
     
    222222        ////////////////////////
    223223
    224         SetError(121,NULL,cp);
     224        compiler.errorMessenger.Output(121,NULL,cp);
    225225        return false;
    226226    }
     
    268268{
    269269    if( !baseType.IsPointer() ){
    270         SetError(1,NULL,cp);
     270        compiler.errorMessenger.Output(1,NULL,cp);
    271271        return false;
    272272    }
     
    301301            if( !RemoveStringQuotes( tempParamStr ) )
    302302            {
    303                 SetError();
     303                compiler.errorMessenger.OutputFatalError();
    304304            }
    305305
     
    335335            if( !resultType.IsWhole() ){
    336336                // TODO: 実数に未対応
    337                 SetError();
     337                compiler.errorMessenger.OutputFatalError();
    338338                isSuccessful = false;
    339339                break;
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Delegate.cpp

    r449 r465  
    2020        if( !compiler.StringToType( returnTypeName, returnType ) )
    2121        {
    22             SetError(3,returnTypeName,sourceIndex);
     22            compiler.errorMessenger.Output(3,returnTypeName,sourceIndex);
    2323        }
    2424    }
     
    7272        else if( source[i] == 1 && source[i+1] == ESC_ENDNAMESPACE ){
    7373            if( namespaceScopes.size() <= 0 ){
    74                 SetError(12, "End Namespace", i );
     74                compiler.errorMessenger.Output(12, "End Namespace", i );
    7575            }
    7676            else{
     
    9191            if( !compiler.GetNamespaceSupporter().ImportsNamespace( temporary ) )
    9292            {
    93                 SetError(64,temporary,i );
     93                compiler.errorMessenger.Output(64,temporary,i );
    9494            }
    9595
     
    108108            if( !( source[i] == 1 && ( source[i+1] == ESC_SUB || source[i+1] == ESC_FUNCTION ) ) )
    109109            {
    110                 SetError(1,NULL,i);
     110                compiler.errorMessenger.Output(1,NULL,i);
    111111                continue;
    112112            }
     
    125125            if( source[i] != '(' )
    126126            {
    127                 SetError(1,NULL,nowLine);
     127                compiler.errorMessenger.Output(1,NULL,nowLine);
    128128                continue;
    129129            }
     
    142142                if( procKind != Procedure::Function )
    143143                {
    144                     SetError(38,name,nowLine);
     144                    compiler.errorMessenger.Output(38,name,nowLine);
    145145                }
    146146            }
     
    149149                if( procKind == Procedure::Function )
    150150                {
    151                     SetError(-104,name,nowLine);
     151                    compiler.errorMessenger.Output(-104,name,nowLine);
    152152                    lstrcpy( returnTypeName, "Double" );
    153153                }
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Enum.cpp

    r424 r465  
    1818        }
    1919        if(!IsVariableChar(buffer[i])){
    20             SetError(1,NULL,i);
     20            compiler.errorMessenger.Output(1,NULL,i);
    2121            break;
    2222        }
     
    2525
    2626    if(buffer[i]=='\0'){
    27         SetError(22,"Enum",nowLine);
     27        compiler.errorMessenger.Output(22,"Enum",nowLine);
    2828        return;
    2929    }
     
    5252        if(temporary[0]=='\0'){
    5353            if(buffer[i]=='\0'){
    54                 SetError(22,"Enum",nowLine);
     54                compiler.errorMessenger.Output(22,"Enum",nowLine);
    5555                break;
    5656            }
     
    131131        else if( source[i] == 1 && source[i+1] == ESC_ENDNAMESPACE ){
    132132            if( namespaceScopes.size() <= 0 ){
    133                 SetError(12, "End Namespace", i );
     133                compiler.errorMessenger.Output(12, "End Namespace", i );
    134134            }
    135135            else{
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Exception.cpp

    r391 r465  
    120120        if( isDefinedFinally )
    121121        {
    122             SetError(71,NULL,cp);
     122            compiler.errorMessenger.Output(71,NULL,cp);
    123123            return;
    124124        }
     
    146146        if( isDefinedFinally )
    147147        {
    148             SetError(70,NULL,cp);
     148            compiler.errorMessenger.Output(70,NULL,cp);
    149149            return;
    150150        }
     
    173173        if( !isDefinedFinally )
    174174        {
    175             SetError();
     175            compiler.errorMessenger.OutputFatalError();
    176176        }
    177177
     
    259259    if( tryScopes.size() == 0 )
    260260    {
    261         SetError(1,NULL,cp);
     261        compiler.errorMessenger.Output(1,NULL,cp);
    262262        return;
    263263    }
     
    271271        if( !typeName[0] )
    272272        {
    273             SetError(72,NULL,cp);
     273            compiler.errorMessenger.Output(72,NULL,cp);
    274274        }
    275275        else
     
    277277            if( !compiler.StringToType( typeName, paramType ) )
    278278            {
    279                 SetError(74,typeName,cp);
     279                compiler.errorMessenger.Output(74,typeName,cp);
    280280            }
    281281            else
     
    283283                if( !paramType.IsObject() )
    284284                {
    285                     SetError(73,typeName,cp);
     285                    compiler.errorMessenger.Output(73,typeName,cp);
    286286                }
    287287            }
     
    296296    if( paramType.IsObject() )
    297297    {
    298         sprintf( temporary, "Dim %s = Thread.CurrentThread().__GetThrowintParamObject() As %s", varName, paramType.GetClass().GetFullName().c_str() );
     298        sprintf( temporary, "Dim %s = System.Threading.Thread.CurrentThread().__GetThrowintParamObject() As %s", varName, paramType.GetClass().GetFullName().c_str() );
    299299        MakeMiddleCode( temporary );
    300300        ChangeOpcode( temporary );
    301301    }
    302     lstrcpy( temporary, "Thread.CurrentThread().__Catched()" );
     302    lstrcpy( temporary, "System.Threading.Thread.CurrentThread().__Catched()" );
    303303    MakeMiddleCode( temporary );
    304304    ChangeOpcode( temporary );
     
    326326    if( tryScopes.size() == 0 )
    327327    {
    328         SetError(12,"End Try",cp);
     328        compiler.errorMessenger.Output(12,"End Try",cp);
    329329        return;
    330330    }
     
    333333    {
    334334        // CatchもFinallyも存在しないとき
    335         SetError(-108,NULL,tryScopes.back().GetSourceCodePos() );
     335        compiler.errorMessenger.Output(-108,NULL,tryScopes.back().GetSourceCodePos() );
    336336    }
    337337
     
    364364    while( tryScopes.size() > 0 )
    365365    {
    366         SetError(22, "Try", tryScopes.back().GetSourceCodePos() );
     366        compiler.errorMessenger.Output(22, "Try", tryScopes.back().GetSourceCodePos() );
    367367
    368368        EndTryCommand( true );
     
    393393    if( tryScopes.size() == 0 )
    394394    {
    395         SetError(1,NULL,cp);
     395        compiler.errorMessenger.Output(1,NULL,cp);
    396396        return;
    397397    }
     
    424424    if( tryScopes.size() == 0 )
    425425    {
    426         SetError(1,NULL,cp);
     426        compiler.errorMessenger.Output(1,NULL,cp);
    427427        return;
    428428    }
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalScope.cpp

    r392 r465  
    6464void LexicalScopes::End(){
    6565    if( level <= 0 ){
    66         SetError();
     66        compiler.errorMessenger.OutputFatalError();
    6767        return;
    6868    }
     
    154154            if( UserProc::IsGlobalAreaCompiling() ){
    155155                //ここには来ないハズ
    156                 SetError(300,NULL,cp);
     156                compiler.errorMessenger.Output(300,NULL,cp);
    157157            }
    158158        }
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Linker.cpp

    r414 r465  
    113113                && schedule.GetUserProc().GetEndOpAddress() == 0 )
    114114            {
    115                 SetError();
     115                compiler.errorMessenger.OutputFatalError();
    116116            }
    117117
     
    252252    if( nativeCode.GetSize() > 0 )
    253253    {
    254         SetError();
     254        compiler.errorMessenger.OutputFatalError();
    255255    }
    256256
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Method.cpp

    r396 r465  
    1111    {
    1212        // Override修飾子が無い状況で基底クラスの実体メソッドをオーバーライドしようとした
    13         SetError(127,NULL,cp);
     13        compiler.errorMessenger.Output(127,NULL,cp);
    1414    }
    1515
     
    2121    {
    2222        // オーバーライドミス
    23         SetError(136, pUserProc->GetName(), cp);
     23        compiler.errorMessenger.Output(136, pUserProc->GetName(), cp);
    2424    }
    2525    if(this->GetAccessibility() != accessibility )
    2626    {
    27         SetError(128,NULL,cp);
     27        compiler.errorMessenger.Output(128,NULL,cp);
    2828    }
    2929
     
    3535{
    3636    // 静的メソッドがコピーコンストラトされることは想定しない
    37     SetError();
     37    compiler.errorMessenger.OutputFatalError();
    3838}
    3939
     
    160160
    161161            if(pMethod->IsAbstract()){
    162                 SetError();
     162                compiler.errorMessenger.OutputFatalError();
    163163
    164164                ppsi[i2]=0;
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/NamespaceSupporter.cpp

    r461 r465  
    4646        else if( source[i] == 1 && source[i+1] == ESC_ENDNAMESPACE ){
    4747            if( namespaceScopes.size() <= 0 ){
    48                 SetError( 12, "End Namespace", i );
     48                compiler.errorMessenger.Output( 12, "End Namespace", i );
    4949                isSuccessful = false;
    5050            }
     
    5959
    6060    if( namespaceScopes.size() > 0 ){
    61         SetError( 63, NULL, cp );
     61        compiler.errorMessenger.Output( 63, NULL, cp );
    6262        isSuccessful = false;
    6363    }
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/NativeCode.cpp

    r370 r465  
    44
    55#define BREAK_EIP(checkEip)  (obp+0x00401000>=checkEip)
     6
     7const ::DllProc &Schedule::GetDllProc() const
     8{
     9    if( type != Schedule::DllProc )
     10    {
     11        compiler.errorMessenger.OutputFatalError();
     12    }
     13    return *pDllProc;
     14}
     15const ::UserProc &Schedule::GetUserProc() const
     16{
     17    if( !( type == Schedule::UserProc || type == Schedule::AddressOf || type == Schedule::CatchAddress ) )
     18    {
     19        compiler.errorMessenger.OutputFatalError();
     20    }
     21    return *pUserProc;
     22}
     23const ::CClass &Schedule::GetClass() const
     24{
     25    if( !( type == Schedule::ComVtbl || type == Schedule::Vtbl || type == Schedule::TypeInfo ) )
     26    {
     27        compiler.errorMessenger.OutputFatalError();
     28    }
     29    return *pClass;
     30}
     31
     32void Schedule::SpecifyAddressOf()
     33{
     34    if( type != Schedule::UserProc )
     35    {
     36        compiler.errorMessenger.OutputFatalError();
     37    }
     38    type = Schedule::AddressOf;
     39}
     40void Schedule::SpecifyCatchAddress()
     41{
     42    if( type != Schedule::UserProc )
     43    {
     44        compiler.errorMessenger.OutputFatalError();
     45    }
     46    type = Schedule::CatchAddress;
     47}
    648
    749void NativeCode::PutEx( const NativeCode &nativeCode )
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Parameter.cpp

    r448 r465  
    145145            if( isRef == false )
    146146            {
    147                 SetError(29,NULL,nowLine);
     147                compiler.errorMessenger.Output(29,NULL,nowLine);
    148148            }
    149149            isArray = true;
     
    206206
    207207            if( type.IsNull() ){
    208                 SetError(3,temporary,nowLine);
     208                compiler.errorMessenger.Output(3,temporary,nowLine);
    209209                type.SetBasicType( DEF_PTR_VOID );
    210210            }
     
    219219        else{
    220220            type.SetBasicType( Type::GetBasicTypeFromSimpleName(temporary) );
    221             SetError(-103,temporary,nowLine);
     221            compiler.errorMessenger.Output(-103,temporary,nowLine);
    222222        }
    223223
     
    240240        }
    241241        else{
    242             SetError(1,NULL,nowLine);
     242            compiler.errorMessenger.Output(1,NULL,nowLine);
    243243            break;
    244244        }
  • 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    }
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Source.cpp

    r461 r465  
    678678                if( !source.ReadFile_InIncludeDirective( temporary ) ){
    679679                    sprintf(temp2,"インクルードファイル \"%s\" をオープンできません",temporary);
    680                     SetError(-1,temp2,i);
     680                    compiler.errorMessenger.Output(-1,temp2,i);
    681681                    break;
    682682                }
     
    920920    for( int i=0; genBuffer[i] ; i++ ){
    921921        if( genBuffer[i] == '\n' ){
    922             SetError();
     922            compiler.errorMessenger.OutputFatalError();
    923923            break;
    924924        }
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Type.cpp

    r461 r465  
    116116    }
    117117
    118     SetError();
     118    compiler.errorMessenger.OutputFatalError();
    119119
    120120    return 0;
     
    219219    {
    220220        if( !pClass ){
    221             SetError();
     221            compiler.errorMessenger.OutputFatalError();
    222222            return 0;
    223223        }
     
    232232    }
    233233
    234     SetError();
     234    compiler.errorMessenger.OutputFatalError();
    235235    return 0;
    236236}
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/TypeDef.cpp

    r461 r465  
    1010{
    1111    if( !compiler.StringToType( baseName, baseType ) ){
    12         SetError(3, baseName, nowLine );
     12        compiler.errorMessenger.Output(3, baseName, nowLine );
    1313        return;
    1414    }
     
    8787
    8888    if(expression[i]!='='){
    89         SetError(10,"TypeDef",nowLine);
     89        compiler.errorMessenger.Output(10,"TypeDef",nowLine);
    9090        return;
    9191    }
     
    9898        if(temporary[i]=='\0') break;
    9999        if( !( IsVariableChar( temporary[i], true) ) ){
    100             SetError(10,"TypeDef",nowLine);
     100            compiler.errorMessenger.Output(10,"TypeDef",nowLine);
    101101            return;
    102102        }
     
    107107        //関数ポインタ
    108108        if(pTemp[3]!='('){
    109             SetError(10,"TypeDef",nowLine);
     109            compiler.errorMessenger.Output(10,"TypeDef",nowLine);
    110110            return;
    111111        }
     
    118118            if( !( IsVariableChar( pTemp[i], true) ) )
    119119            {
    120                 SetError(10,"TypeDef",nowLine);
     120                compiler.errorMessenger.Output(10,"TypeDef",nowLine);
    121121                return;
    122122            }
     
    126126    //識別子が重複している場合はエラーにする
    127127    if(lstrcmp(temporary,pTemp)==0){
    128         SetError(1,NULL,nowLine);
     128        compiler.errorMessenger.Output(1,NULL,nowLine);
    129129        return;
    130130    }
     
    170170        else if( basbuf[i] == 1 && basbuf[i+1] == ESC_ENDNAMESPACE ){
    171171            if( namespaceScopes.size() <= 0 ){
    172                 SetError(12, "End Namespace", i );
     172                compiler.errorMessenger.Output(12, "End Namespace", i );
    173173            }
    174174            else{
     
    189189            if( !compiler.GetNamespaceSupporter().ImportsNamespace( temporary ) )
    190190            {
    191                 SetError(64,temporary,i );
     191                compiler.errorMessenger.Output(64,temporary,i );
    192192            }
    193193
Note: See TracChangeset for help on using the changeset viewer.