Changeset 465 in dev for trunk/ab5.0


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

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

Location:
trunk/ab5.0
Files:
3 added
63 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/BasicCompiler32/BasicCompiler.vcproj

    r461 r465  
    12661266                    >
    12671267                </File>
     1268                <File
     1269                    RelativePath="..\BasicCompiler_Common\src\Messenger.cpp"
     1270                    >
     1271                </File>
    12681272                <Filter
    12691273                    Name="Langauge Classes"
     
    14711475                    >
    14721476                </File>
     1477                <File
     1478                    RelativePath="..\BasicCompiler_Common\include\Messenger.h"
     1479                    >
     1480                </File>
    14731481                <Filter
    14741482                    Name="Language Classes"
  • trunk/ab5.0/abdev/BasicCompiler32/CParameter.cpp

    r437 r465  
    239239                char temp2[255];
    240240                sprintf(temp2,"%s関数の第%dパラメータ",procName.c_str(),i2+1);
    241                 SetError(19,temp2,cp);
     241                compiler.errorMessenger.Output(19,temp2,cp);
    242242                continue;
    243243            }
     
    306306            }
    307307            else{
    308                 SetError(300,NULL,cp);
     308                compiler.errorMessenger.Output(300,NULL,cp);
    309309            }
    310310        }
     
    368368                                    if( dummyType.IsObject() ){
    369369                                        if( !dummyType.GetClass().IsEqualsOrSubClass( &varType.GetClass() ) ){
    370                                             SetError(11,Parms[i2],cp);
     370                                            compiler.errorMessenger.Output(11,Parms[i2],cp);
    371371                                        }
    372372                                    }
    373373                                    else if( dummyType.IsStruct() ){
    374374                                        if( !dummyType.GetClass().IsEquals( &varType.GetClass() ) ){
    375                                             SetError(11,Parms[i2],cp);
     375                                            compiler.errorMessenger.Output(11,Parms[i2],cp);
    376376                                        }
    377377                                    }
     
    382382                                }
    383383                                else{
    384                                     SetError(11,Parms[i2],cp);
     384                                    compiler.errorMessenger.Output(11,Parms[i2],cp);
    385385                                }
    386386                            }
  • trunk/ab5.0/abdev/BasicCompiler32/Compile_Calc.cpp

    r461 r465  
    130130        compiler.codeGenerator.op_fstp_basereg( DEF_DOUBLE, REG_ESP );
    131131    }
    132     else SetError(9,NULL,cp);
     132    else compiler.errorMessenger.Output(9,NULL,cp);
    133133}
    134134void ChangeTypeToSingle(int OldType){
     
    198198        compiler.codeGenerator.op_fstp_basereg( DEF_SINGLE, REG_ESP );
    199199    }
    200     else SetError(9,NULL,cp);
     200    else compiler.errorMessenger.Output(9,NULL,cp);
    201201}
    202202
     
    254254        }
    255255    }
    256     else SetError(9,NULL,cp);
     256    else compiler.errorMessenger.Output(9,NULL,cp);
    257257}
    258258void ChangeTypeToLong(int OldType){
     
    393393    }
    394394    else{
    395         SetError(300,NULL,cp);
     395        compiler.errorMessenger.Output(300,NULL,cp);
    396396    }
    397397}
     
    411411            //ダブルクォートは不正なのでエラー扱い
    412412            variable[i]=0;
    413             SetError(3,variable,cp);
     413            compiler.errorMessenger.Output(3,variable,cp);
    414414            return;
    415415        }
     
    458458            if(GetVarType(variable,Type(),0)){
    459459                //変数リストに該当したとき
    460                 SetError(1,NULL,cp);
     460                compiler.errorMessenger.Output(1,NULL,cp);
    461461            }
    462462            else{
     
    465465                {
    466466                    //定数リストに該当したとき
    467                     SetError(1,NULL,cp);
     467                    compiler.errorMessenger.Output(1,NULL,cp);
    468468                }
    469469                else{
    470470                    //変数リスト、定数リストに該当しないとき
    471                     SetError(3,variable,cp);
     471                    compiler.errorMessenger.Output(3,variable,cp);
    472472                }
    473473            }
     
    491491
    492492    if(Command[i+1]=='\0'){
    493         SetError(1,NULL,cp);
     493        compiler.errorMessenger.Output(1,NULL,cp);
    494494        return;
    495495    }
     
    531531
    532532    if( lstrcmpi( variable, "This" ) == 0 ){
    533         SetError(133,NULL,cp);
     533        compiler.errorMessenger.Output(133,NULL,cp);
    534534        return;
    535535    }
     
    593593    if( !TermOpeOnlyVariable( variable, varType, VarRelativeVar, true ) )
    594594    {
    595         SetError();
     595        compiler.errorMessenger.OutputFatalError();
    596596        return;
    597597    }
    598598
    599599    if(varType.GetBasicType()&FLAG_PTR){
    600         SetError(14,variable,cp);
     600        compiler.errorMessenger.Output(14,variable,cp);
    601601        return;
    602602    }
     
    614614        compiler.GetObjectModule().meta.GetBlittableTypes().GetClass( calcType ).GetStaticMethods().Enum( "_Create", userProcs );
    615615        if( userProcs.size() != 1 ){
    616             SetError();
     616            compiler.errorMessenger.OutputFatalError();
    617617            return;
    618618        }
  • trunk/ab5.0/abdev/BasicCompiler32/Compile_Calc_PushVar.cpp

    r308 r465  
    2121    }
    2222    else if(pRelativeVar->dwKind==VAR_REFGLOBAL){
    23         SetError(300,NULL,cp);
     23        compiler.errorMessenger.Output(300,NULL,cp);
    2424    }
    2525    else if(pRelativeVar->dwKind==VAR_LOCAL){
     
    6868        //64ビットの場合はedx:eaxにロード
    6969        if(reg!=REG_EAX){
    70             SetError(300,NULL,cp);
     70            compiler.errorMessenger.Output(300,NULL,cp);
    7171            return;
    7272        }
  • trunk/ab5.0/abdev/BasicCompiler32/Compile_CallProc.cpp

    r461 r465  
    135135                    }
    136136                    else{
    137                         SetError(300,NULL,cp);
     137                        compiler.errorMessenger.Output(300,NULL,cp);
    138138                    }
    139139                }
     
    163163            pMethod = pobj_c->GetStaticMethods().GetMethodPtr( pUserProc );
    164164            if( !pMethod ){
    165                 SetError(300,NULL,cp);
     165                compiler.errorMessenger.Output(300,NULL,cp);
    166166                return false;
    167167            }
     
    181181                //同一クラスオブジェクトの場合はプライベートアクセスを容認する
    182182                if( pMethod->IsNoneAccess() ){
    183                     SetError(109,pUserProc->GetName(),cp);
     183                    compiler.errorMessenger.Output(109,pUserProc->GetName(),cp);
    184184                    return false;
    185185                }
     
    188188                if( pMethod->IsPrivate()
    189189                    || pMethod->IsNoneAccess() ){
    190                     SetError(109,pUserProc->GetName(),cp);
     190                    compiler.errorMessenger.Output(109,pUserProc->GetName(),cp);
    191191                    return false;
    192192                }
    193193                if( !pMethod->GetUserProc().GetParentClass().IsEqualsOrSubClass( pobj_c ) && pMethod->IsProtected() ){
    194                     SetError(110,pUserProc->GetName(),cp);
     194                    compiler.errorMessenger.Output(110,pUserProc->GetName(),cp);
    195195                    return false;
    196196                }
     
    200200            //クラス内部からの呼び出し(継承によるACCESS_NONのみをエラーとする)
    201201            if( pMethod->IsNoneAccess() ){
    202                 SetError(109,pUserProc->GetName(),cp);
     202                compiler.errorMessenger.Output(109,pUserProc->GetName(),cp);
    203203                return false;
    204204            }
     
    296296                if( !resultType.IsObject() )
    297297                {
    298                     SetError();
     298                    compiler.errorMessenger.OutputFatalError();
    299299                }
    300300
     
    344344            if( vtblMasterListIndex != 0 )
    345345            {
    346                 SetError();
     346                compiler.errorMessenger.OutputFatalError();
    347347            }
    348348        }
  • trunk/ab5.0/abdev/BasicCompiler32/Compile_Func.cpp

    r461 r465  
    263263                    || type.IsObjectPtr() && referenceKind == RefPointer ) )
    264264                {
    265                     SetError(104,ObjectName,cp);
     265                    compiler.errorMessenger.Output(104,ObjectName,cp);
    266266                }
    267267
     
    305305            if( vtblMasterListIndex != 0 )
    306306            {
    307                 SetError();
     307                compiler.errorMessenger.OutputFatalError();
    308308            }
    309309        }
     
    400400        {
    401401            extern int cp;
    402             SetError(1,NULL,cp);
     402            compiler.errorMessenger.Output(1,NULL,cp);
    403403            return;
    404404        }
     
    460460        GetOverloadSubHash( name, subs );
    461461        if( subs.size() == 0 ){
    462             SetError(27,name,cp);
     462            compiler.errorMessenger.Output(27,name,cp);
    463463            return;
    464464        }
     
    480480                    ) )
    481481                {
    482                     SetError(67, name, cp );
     482                    compiler.errorMessenger.Output(67, name, cp );
    483483                }
    484484            }
     
    491491                    ) )
    492492                {
    493                     SetError(66, name, cp );
     493                    compiler.errorMessenger.Output(66, name, cp );
    494494                }
    495495            }
     
    497497
    498498        if(!pUserProc){
    499             SetError(27,name,cp);
     499            compiler.errorMessenger.Output(27,name,cp);
    500500            return;
    501501        }
     
    504504        pUserProc=GetSubHash(name);
    505505        if(!pUserProc){
    506             SetError(27,name,cp);
     506            compiler.errorMessenger.Output(27,name,cp);
    507507            return;
    508508        }
     
    531531    Type tempType;
    532532    if( !compiler.StringToType( typeName, tempType ) ){
    533         SetError(3,typeName,cp);
     533        compiler.errorMessenger.Output(3,typeName,cp);
    534534        return;
    535535    }
     
    597597    }
    598598    else{
    599         SetError(134,NULL,cp );
     599        compiler.errorMessenger.Output(134,NULL,cp );
    600600    }
    601601}
     
    680680    }
    681681    if(!tempType.IsWhole()){
    682         SetError(11,Parameter,cp);
     682        compiler.errorMessenger.Output(11,Parameter,cp);
    683683        return;
    684684    }
  • trunk/ab5.0/abdev/BasicCompiler32/Compile_Object.cpp

    r391 r465  
    2222
    2323    if(bSomeObjects){
    24         SetError();
     24        compiler.errorMessenger.OutputFatalError();
    2525
    2626        //push ebx
     
    6464        }
    6565        else{
    66             SetError();
     66            compiler.errorMessenger.OutputFatalError();
    6767        }
    6868
     
    110110    if(pClass->IsAbstract()){
    111111        //抽象クラスだったとき
    112         SetError(125,pClass->GetName(),cp);
     112        compiler.errorMessenger.Output(125,pClass->GetName(),cp);
    113113    }
    114114
     
    119119        Type tempType;
    120120        NumOpe(objectSizeStr,Type(),tempType);
    121         if( !tempType.IsWhole() ) SetError(49,NULL,cp);
     121        if( !tempType.IsWhole() ) compiler.errorMessenger.Output(49,NULL,cp);
    122122        ChangeTypeToLong(tempType.GetBasicType());
    123123
     
    269269        return;
    270270    }
    271     if(!( tempType.IsObjectPtr() || tempType.IsVoidPtr() )) SetError(122,NULL,cp);
     271    if(!( tempType.IsObjectPtr() || tempType.IsVoidPtr() )) compiler.errorMessenger.Output(122,NULL,cp);
    272272
    273273    //pop eax
  • trunk/ab5.0/abdev/BasicCompiler32/Compile_ProcOp.cpp

    r461 r465  
    197197    }
    198198    else{
    199         SetError();
     199        compiler.errorMessenger.OutputFatalError();
    200200    }
    201201}
     
    242242        {
    243243            if(pGotoLabelSchedule->GetName().size()>0){
    244                 SetError(6,pGotoLabelSchedule->GetName(),pGotoLabelSchedule->GetSourceCodePos());
     244                compiler.errorMessenger.Output(6,pGotoLabelSchedule->GetName(),pGotoLabelSchedule->GetSourceCodePos());
    245245            }
    246246            else{
    247247                char temporary[255];
    248248                sprintf(temporary,"%d",pGotoLabelSchedule->GetLineNum());
    249                 SetError(6,temporary,pGotoLabelSchedule->GetSourceCodePos());
     249                compiler.errorMessenger.Output(6,temporary,pGotoLabelSchedule->GetSourceCodePos());
    250250            }
    251251        }
     
    273273    }
    274274    else{
    275         SetError();
     275        compiler.errorMessenger.OutputFatalError();
    276276    }
    277277}
     
    285285
    286286    if( pUserProc->GetLocalVars().size() ){
    287         SetError();
     287        compiler.errorMessenger.OutputFatalError();
    288288        return;
    289289    }
     
    311311    {
    312312        // 既にコード生成が行われている場合はエラー
    313         SetError();
     313        compiler.errorMessenger.OutputFatalError();
    314314    }
    315315
     
    531531                    }
    532532                    if(!(temporary[0]=='('&&temporary[lstrlen(temporary)-1]==')')){
    533                         SetError(1,NULL,cp);
     533                        compiler.errorMessenger.Output(1,NULL,cp);
    534534                    }
    535535                    RemoveStringPare(temporary);
     
    618618    //With情報のメモリを解放
    619619    for(i3=0;i3<WithInfo.num;i3++){
    620         SetError(22,"With",WithInfo.pWithCp[i3]);
     620        compiler.errorMessenger.Output(22,"With",WithInfo.pWithCp[i3]);
    621621        HeapDefaultFree(WithInfo.ppName[i3]);
    622622    }
     
    710710        else
    711711        {
    712             SetError();
     712            compiler.errorMessenger.OutputFatalError();
    713713        }
    714714    }
  • trunk/ab5.0/abdev/BasicCompiler32/Compile_Set_Var.cpp

    r461 r465  
    5050    }
    5151
    52     SetError(1,NULL,cp);
     52    compiler.errorMessenger.Output(1,NULL,cp);
    5353}
    5454
     
    155155    if(type==DEF_DOUBLE){
    156156        // TODO: 実装
    157         SetError();
     157        compiler.errorMessenger.OutputFatalError();
    158158    }
    159159    else if(type==DEF_SINGLE){
    160160        // TODO: 実装
    161         SetError();
     161        compiler.errorMessenger.OutputFatalError();
    162162    }
    163163    else if(type==DEF_INT64||type==DEF_QWORD){
     
    180180        if(!IsWholeNumberType(type)){
    181181            //不正な型の場合
    182             SetError(9,NULL,cp);
     182            compiler.errorMessenger.Output(9,NULL,cp);
    183183            return;
    184184        }
     
    327327    else if(pRelative->dwKind==VAR_REFGLOBAL){
    328328        // 今は使われていない
    329         SetError();
     329        compiler.errorMessenger.OutputFatalError();
    330330
    331331        if(pRelative->bOffsetOffset){
  • trunk/ab5.0/abdev/BasicCompiler32/Compile_Statement.cpp

    r435 r465  
    1616            //ダブルクォートは不正なのでエラー扱い
    1717            leftTerm[i]=0;
    18             SetError(3,leftTerm,cp);
     18            compiler.errorMessenger.Output(3,leftTerm,cp);
    1919            return;
    2020        }
     
    4848        (leftTerm[0]==1&&leftTerm[1]==ESC_PSMEM)
    4949        )){
    50         SetError(1,NULL,cp);
     50        compiler.errorMessenger.Output(1,NULL,cp);
    5151        return;
    5252    }
     
    7676        if(pUserProc){
    7777            if( !pUserProc->IsMacro() ){
    78                 SetError(10,Command,cp);
     78                compiler.errorMessenger.Output(10,Command,cp);
    7979            }
    8080
     
    117117
    118118    // どこにも当てはまらなかったため、失敗
    119     SetError(1,NULL,cp);
     119    compiler.errorMessenger.Output(1,NULL,cp);
    120120}
    121121
     
    126126    for(i=0;;i++){
    127127        if(Parameter[i]=='\0'){
    128             SetError(21,NULL,cp);
     128            compiler.errorMessenger.Output(21,NULL,cp);
    129129            return;
    130130        }
     
    355355    compiler.codeGenerator.ContinueAreaBegin();
    356356
    357     if(!Parameter[0]) SetError(10,"While",cp);
     357    if(!Parameter[0]) compiler.errorMessenger.Output(10,"While",cp);
    358358
    359359    const PertialSchedule *pWhilePertialSchedule = NULL;
     
    483483    i=GetOneParameter(Parameter,0,temporary);
    484484    if(!Parameter[i]){
    485         SetError(12,"For",cp);
     485        compiler.errorMessenger.Output(12,"For",cp);
    486486        goto ErrorStep;
    487487    }
     
    496496        }
    497497        if(temporary[i2]=='\0'){
    498             SetError(12,"For",cp);
     498            compiler.errorMessenger.Output(12,"For",cp);
    499499            goto ErrorStep;
    500500        }
     
    514514    if(Parameter[i]){
    515515        i=GetOneParameter(Parameter,i,StepNum);
    516         if(Parameter[i]) SetError(12,"For",cp);
     516        if(Parameter[i]) compiler.errorMessenger.Output(12,"For",cp);
    517517    }
    518518    else lstrcpy(StepNum,"1");
     
    578578    if(szNextVariable[0]){
    579579        if(lstrcmp(szNextVariable,variable)!=0){
    580             SetError(55,szNextVariable,cp);
     580            compiler.errorMessenger.Output(55,szNextVariable,cp);
    581581        }
    582582    }
     
    608608    GetCustomToken( variable, Parameter, i, ESC_IN, true );
    609609    if(!Parameter[i]){
    610         SetError(12,"Foreach",cp);
     610        compiler.errorMessenger.Output(12,"Foreach",cp);
    611611        isError = true;
    612612        goto ErrorStep;
     
    667667    if(szNextVariable[0]){
    668668        if(lstrcmp(szNextVariable,variable)!=0){
    669             SetError(55,szNextVariable,cp);
     669            compiler.errorMessenger.Output(55,szNextVariable,cp);
    670670        }
    671671    }
     
    691691    int i,i2,i3;
    692692
    693     if(Parameter[0]) SetError(10,"Do",cp);
     693    if(Parameter[0]) compiler.errorMessenger.Output(10,"Do",cp);
    694694
    695695    //Continueアドレスのバックアップとセット
     
    894894void OpcodeExitSub(void){
    895895    if( UserProc::IsGlobalAreaCompiling() ){
    896         SetError(12,"Exit Sub/Function",cp);
     896        compiler.errorMessenger.Output(12,"Exit Sub/Function",cp);
    897897        return;
    898898    }
     
    942942            if(basbuf[i]=='\0'){
    943943                selectSchedules.pop_back();
    944                 SetError(22,"Select",cp);
     944                compiler.errorMessenger.Output(22,"Select",cp);
    945945                return;
    946946            }
     
    11631163
    11641164    if(selectSchedules.back().typeSize==-1){
    1165         SetError(30,"Case",cp);
     1165        compiler.errorMessenger.Output(30,"Case",cp);
    11661166        return;
    11671167    }
     
    12821282    i=GetOneParameter(Parameter,0,temporary);
    12831283    if(!Parameter[i]){
    1284         SetError(1,NULL,cp);
     1284        compiler.errorMessenger.Output(1,NULL,cp);
    12851285        return;
    12861286    }
     
    12911291    }
    12921292    if(!resultType.IsWhole()){
    1293         SetError(11,Parameter,cp);
     1293        compiler.errorMessenger.Output(11,Parameter,cp);
    12941294        return;
    12951295    }
     
    13001300    i=GetOneParameter(Parameter,i,temporary);
    13011301    if(Parameter[i]){
    1302         SetError(1,NULL,cp);
     1302        compiler.errorMessenger.Output(1,NULL,cp);
    13031303        return;
    13041304    }
  • trunk/ab5.0/abdev/BasicCompiler32/Compile_Var.cpp

    r461 r465  
    3535    else{
    3636        //エラー
    37         SetError(1,NULL,cp);
     37        compiler.errorMessenger.Output(1,NULL,cp);
    3838        return;
    3939    }
     
    185185    if( !pMember )
    186186    {
    187         if(isErrorEnabled) SetError(103,VarName,cp);
     187        if(isErrorEnabled) compiler.errorMessenger.Output(103,VarName,cp);
    188188        return false;
    189189    }
     
    196196        //同一クラスオブジェクトの場合はプライベートアクセスを容認する
    197197        if(pMember->IsNoneAccess()){
    198             if(isErrorEnabled) SetError(107,VarName,cp);
     198            if(isErrorEnabled) compiler.errorMessenger.Output(107,VarName,cp);
    199199            return false;
    200200        }
     
    203203        if((bPrivateAccess==0&&pMember->IsPrivate())||
    204204            pMember->IsNoneAccess()){
    205             if(isErrorEnabled) SetError(107,VarName,cp);
     205            if(isErrorEnabled) compiler.errorMessenger.Output(107,VarName,cp);
    206206            return false;
    207207        }
    208208        else if(bPrivateAccess==0&&pMember->IsProtected()){
    209             if(isErrorEnabled) SetError(108,VarName,cp);
     209            if(isErrorEnabled) compiler.errorMessenger.Output(108,VarName,cp);
    210210            return false;
    211211        }
     
    219219        ){
    220220            //Const定義の変数に書き込みアクセスをしようとした場合
    221             SetError(61,VarName,cp);
     221            compiler.errorMessenger.Output(61,VarName,cp);
    222222    }
    223223
     
    237237    else{
    238238        if(lpPtrOffset[0]){
    239             if(isErrorEnabled) SetError(16,member,cp);
     239            if(isErrorEnabled) compiler.errorMessenger.Output(16,member,cp);
    240240            return false;
    241241        }
     
    250250        //配列オフセット
    251251        if(!GetArrayOffset(pMember->GetSubscripts(),array,pMember->GetType())){
    252             if(isErrorEnabled) SetError(14,member,cp);
     252            if(isErrorEnabled) compiler.errorMessenger.Output(14,member,cp);
    253253            return false;
    254254        }
     
    263263        if( resultType.IsObject() || resultType.IsStruct() ){
    264264            if( refType != RefDot ){
    265                 if(isErrorEnabled) SetError(104,member,cp);
     265                if(isErrorEnabled) compiler.errorMessenger.Output(104,member,cp);
    266266                return false;
    267267            }
     
    279279                if( ( resultType.IsObjectPtr() || resultType.IsStructPtr() )
    280280                    && refType != RefDot ){
    281                         if(isErrorEnabled) SetError(104,member,cp);
     281                        if(isErrorEnabled) compiler.errorMessenger.Output(104,member,cp);
    282282                        return false;
    283283                }
     
    293293                if( ( resultType.IsObjectPtr() || resultType.IsStructPtr() )
    294294                    && refType != RefPointer ){
    295                         if(isErrorEnabled) SetError(104,member,cp);
     295                        if(isErrorEnabled) compiler.errorMessenger.Output(104,member,cp);
    296296                        return false;
    297297                }
     
    307307                //ppObj[n]->member
    308308                if( refType != RefPointer ){
    309                     if(isErrorEnabled) SetError(104,member,cp);
     309                    if(isErrorEnabled) compiler.errorMessenger.Output(104,member,cp);
    310310                    return false;
    311311                }
     
    321321            }
    322322            else{
    323                 if(isErrorEnabled) SetError(104,member,cp);
     323                if(isErrorEnabled) compiler.errorMessenger.Output(104,member,cp);
    324324                return false;
    325325            }
     
    403403            else{
    404404                if(lpPtrOffset[0]){
    405                     SetError(16,variable,cp);
     405                    compiler.errorMessenger.Output(16,variable,cp);
    406406                    pRelativeVar->dwKind=NON_VAR;
    407407                    return false;
     
    485485            compiler.pCompilingClass->IsCompilingDestructor() == false
    486486            ){
    487                 SetError(131, NULL, cp );
     487                compiler.errorMessenger.Output(131, NULL, cp );
    488488        }
    489489
     
    577577        }
    578578
    579         if(isErrorEnabled) SetError(3,variable,cp);
     579        if(isErrorEnabled) compiler.errorMessenger.Output(3,variable,cp);
    580580        pRelativeVar->dwKind=NON_VAR;
    581581        return false;
     
    593593        else{
    594594            if(lpPtrOffset[0]){
    595                 SetError(16,variable,cp);
     595                compiler.errorMessenger.Output(16,variable,cp);
    596596                pRelativeVar->dwKind=NON_VAR;
    597597                return false;
     
    619619        if( resultType.IsObject() ){
    620620            //オブジェクト定数
    621             SetError(130, VarName, cp );
     621            compiler.errorMessenger.Output(130, VarName, cp );
    622622        }
    623623        else{
    624624            //一般のConst変数
    625             SetError(61,VarName,cp);
     625            compiler.errorMessenger.Output(61,VarName,cp);
    626626        }
    627627    }
     
    647647    if(array[0]){
    648648        if(!GetArrayOffset(*pSubscripts,array,resultType)){
    649             SetError(14,variable,cp);
     649            compiler.errorMessenger.Output(14,variable,cp);
    650650            pRelativeVar->dwKind=NON_VAR;
    651651            return false;
     
    656656            //実態オブジェクトのメンバを参照(obj.member)
    657657            if( refType != RefDot ){
    658                 SetError(104,VarName,cp);
     658                compiler.errorMessenger.Output(104,VarName,cp);
    659659                pRelativeVar->dwKind=NON_VAR;
    660660                return false;
     
    671671                //pObj[n].member
    672672                if( refType != RefDot ){
    673                     SetError(104,VarName,cp);
     673                    compiler.errorMessenger.Output(104,VarName,cp);
    674674                    pRelativeVar->dwKind=NON_VAR;
    675675                    return false;
     
    681681                //pObj->member
    682682                if( refType != RefPointer ){
    683                     SetError(104,VarName,cp);
     683                    compiler.errorMessenger.Output(104,VarName,cp);
    684684                    pRelativeVar->dwKind=NON_VAR;
    685685                    return false;
     
    698698                //ppObj[n]->member
    699699                if( refType != RefPointer ){
    700                     SetError(104,VarName,cp);
     700                    compiler.errorMessenger.Output(104,VarName,cp);
    701701                    pRelativeVar->dwKind=NON_VAR;
    702702                    return false;
     
    713713            }
    714714            else{
    715                 SetError(104,VarName,cp);
     715                compiler.errorMessenger.Output(104,VarName,cp);
    716716                pRelativeVar->dwKind=NON_VAR;
    717717                return false;
     
    719719        }
    720720        else{
    721             SetError(102,VarName,cp);
     721            compiler.errorMessenger.Output(102,VarName,cp);
    722722            pRelativeVar->dwKind=NON_VAR;
    723723            return false;
     
    768768                while(1){
    769769                    if( subscripts[0] < i2 ){
    770                         SetError(41,0,cp);
     770                        compiler.errorMessenger.Output(41,0,cp);
    771771                        return 0;
    772772                    }
     
    790790            BOOST_FOREACH( CMember *pMember, objClass.GetDynamicMembers() ){
    791791                if(InitBuf[i]=='\0'){
    792                     SetError(41,0,cp);
     792                    compiler.errorMessenger.Output(41,0,cp);
    793793                    return false;
    794794                }
     
    806806        }
    807807
    808         SetError(41,0,cp);
     808        compiler.errorMessenger.Output(41,0,cp);
    809809        return false;
    810810    }
     
    816816
    817817    if( subscripts.size() > 0 ){
    818         SetError(41,0,cp);
     818        compiler.errorMessenger.Output(41,0,cp);
    819819        return false;
    820820    }
     
    931931                while(1){
    932932                    if( subscripts[0] < i2 ){
    933                         SetError(41,0,cp);
     933                        compiler.errorMessenger.Output(41,0,cp);
    934934                        return 0;
    935935                    }
     
    953953            BOOST_FOREACH( CMember *pMember, objClass.GetDynamicMembers() ){
    954954                if(InitBuf[i]=='\0'){
    955                     SetError(41,0,cp);
     955                    compiler.errorMessenger.Output(41,0,cp);
    956956                    return false;
    957957                }
     
    971971        }
    972972
    973         SetError(41,0,cp);
     973        compiler.errorMessenger.Output(41,0,cp);
    974974        return false;
    975975    }
     
    981981
    982982    if( subscripts.size() > 0 ){
    983         SetError(41,0,cp);
     983        compiler.errorMessenger.Output(41,0,cp);
    984984        return false;
    985985    }
     
    11051105        if( UserProc::CompilingUserProc().GetLocalVars().DuplicateCheck( Symbol( VarName ) ) ){
    11061106            //2重定義のエラー
    1107             SetError(15,VarName,cp);
     1107            compiler.errorMessenger.Output(15,VarName,cp);
    11081108            return;
    11091109        }
     
    12181218        else{
    12191219            if( subscripts.size() > 1 ){
    1220                 SetError(300,NULL,cp);
     1220                compiler.errorMessenger.Output(300,NULL,cp);
    12211221            }
    12221222            sprintf( objectSize, "%d", subscripts[0] );
     
    12301230        GetVarOffset( true, false, VarName, &RelativeVar, Type() );
    12311231        if( RelativeVar.dwKind == VAR_DIRECTMEM ){
    1232             SetError();
     1232            compiler.errorMessenger.OutputFatalError();
    12331233        }
    12341234        SetVariableFromEax( Type( DEF_OBJECT, *compiler.GetObjectModule().meta.GetClasses().GetObjectClassPtr() ), DEF_OBJECT, &RelativeVar );
     
    13061306void SetVarPtrToReg(int reg,RELATIVE_VAR *pRelativeVar){
    13071307    if( reg != REG_EAX ){
    1308         SetError();
     1308        compiler.errorMessenger.OutputFatalError();
    13091309        //TODO: 未完成
    13101310    }
     
    13151315    const UserProc *pUserProc_AddGlobalRootPtr = GetClassMethod( "_System_CGarbageCollection", "AddGlobalRootPtr" );
    13161316    if( !pUserProc_AddGlobalRootPtr ){
    1317         SetError(3, "_System_CGarbageCollection.AddGlobalRootPtr", -1 );
     1317        compiler.errorMessenger.Output(3, "_System_CGarbageCollection.AddGlobalRootPtr", -1 );
    13181318        return false;
    13191319    }
  • trunk/ab5.0/abdev/BasicCompiler32/MakePeHdr.cpp

    r459 r465  
    365365        // 名前空間が初期化されているかをチェック
    366366        if( compiler.GetNamespaceSupporter().GetLivingNamespaceScopes().size() ){
    367             SetError();
     367            compiler.errorMessenger.OutputFatalError();
    368368        }
    369369
     
    443443        //With情報のメモリを解放
    444444        for(i=0;i<WithInfo.num;i++){
    445             SetError(22,"With",WithInfo.pWithCp[i]);
     445            compiler.errorMessenger.Output(22,"With",WithInfo.pWithCp[i]);
    446446            HeapDefaultFree(WithInfo.ppName[i]);
    447447        }
     
    451451        // 名前空間が正しく閉じられているかをチェック
    452452        if( compiler.GetNamespaceSupporter().GetLivingNamespaceScopes().size() ){
    453             SetError(63,NULL,-1);
     453            compiler.errorMessenger.Output(63,NULL,-1);
    454454        }
    455455
     
    504504    }
    505505
    506     extern BOOL bError;
    507     if( !bError )
     506    if( !compiler.errorMessenger.HasError() )
    508507    {
    509         CompileMessage( "リンク中..." );
     508        compiler.messenger.Output( "リンク中..." );
    510509    }
    511510
     
    558557
    559558            if(!hLib){
    560                 SetError(-106,pDllProc->GetDllFileName().c_str(),pDllProc->GetCodePos());
     559                compiler.errorMessenger.Output(-106,pDllProc->GetDllFileName().c_str(),pDllProc->GetCodePos());
    561560            }
    562561        }
     
    565564            if(!GetProcAddress(hLib,pDllProc->GetAlias().c_str())){
    566565                FreeLibrary(hLib);
    567                 SetError(-107,pDllProc->GetAlias(),pDllProc->GetCodePos());
     566                compiler.errorMessenger.Output(-107,pDllProc->GetAlias(),pDllProc->GetCodePos());
    568567            }
    569568            FreeLibrary(hLib);
     
    712711
    713712        if( pDllProc->GetDllFileName().size() > 16 ){
    714             SetError(7,NULL,cp);
     713            compiler.errorMessenger.Output(7,NULL,cp);
    715714            break;
    716715        }
     
    831830    CDebugSection *pobj_DebugSection;
    832831    pobj_DebugSection=new CDebugSection();
    833     extern BOOL bError;
    834     if( compiler.IsDebug() && bError == 0 )
     832    if( compiler.IsDebug() && !compiler.errorMessenger.HasError() )
    835833    {
    836         CompileMessage( "デバッグ情報を生成しています。" );
     834        compiler.messenger.Output( "デバッグ情報を生成しています。" );
    837835
    838836        pobj_DebugSection->make();
    839837
    840         CompileMessage( "デバッグ情報の生成が完了しました。" );
     838        compiler.messenger.Output( "デバッグ情報の生成が完了しました。" );
    841839    }
    842840
     
    11221120
    11231121
    1124     extern BOOL bError;
    1125     if(bError) goto EndWriteOpcode;
     1122    if( compiler.errorMessenger.HasError() )
     1123    {
     1124        goto EndWriteOpcode;
     1125    }
    11261126
    11271127
     
    14141414    hFile=CreateFile(OutputFileName,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
    14151415    if(hFile==INVALID_HANDLE_VALUE){
    1416         SetError(53,OutputFileName,-1);
     1416        compiler.errorMessenger.Output(53,OutputFileName,-1);
    14171417        goto EndWriteOpcode;
    14181418    }
  • trunk/ab5.0/abdev/BasicCompiler32/NumOpe.cpp

    r461 r465  
    5959    }
    6060    else{
    61         SetError();
     61        compiler.errorMessenger.OutputFatalError();
    6262    }
    6363}
     
    7979void ExtendRegToBigType( int reg, int bigBasicType, int baseBasicType ){
    8080    if( reg != REG_EAX ){
    81         SetError();
     81        compiler.errorMessenger.OutputFatalError();
    8282    }
    8383    switch( Type::GetBasicSize( bigBasicType ) ){
     
    190190                // オブジェクトメンバのポインタをeaxにコピー
    191191                if( !VarToReg( tempRelativeVar, baseType, resultType ) ){
    192                     SetError(11,termFull,cp);
     192                    compiler.errorMessenger.Output(11,termFull,cp);
    193193                }
    194194
     
    224224            if( !leftType.IsStruct() )
    225225            {
    226                 SetError();
     226                compiler.errorMessenger.OutputFatalError();
    227227            }
    228228
     
    332332    {
    333333        // 関数ポインタ
    334         SetError();
     334        compiler.errorMessenger.OutputFatalError();
    335335
    336336        ///////////////////////////////////////////////////////////////////
     
    342342    }
    343343
    344     SetError();
     344    compiler.errorMessenger.OutputFatalError();
    345345
    346346    return false;
     
    400400            if( isProcedureCallOnly )
    401401            {
    402                 SetError(1,NULL,cp);
     402                compiler.errorMessenger.Output(1,NULL,cp);
    403403            }
    404404            return false;
     
    432432        if( compiler.pCompilingClass == NULL )
    433433        {
    434             SetError(142,NULL,cp);
     434            compiler.errorMessenger.Output(142,NULL,cp);
    435435            return false;
    436436        }
     
    465465            {
    466466                //閉じカッコ")"に続く文字がNULLでないとき
    467                 SetError(42,NULL,cp);
     467                compiler.errorMessenger.Output(42,NULL,cp);
    468468            }
    469469
     
    525525
    526526                //閉じカッコ")"に続く文字がNULLでないときはエラーにする
    527                 if(termFull[i2+1+i4+1]!='\0') SetError(42,NULL,cp);
     527                if(termFull[i2+1+i4+1]!='\0') compiler.errorMessenger.Output(42,NULL,cp);
    528528
    529529                //マクロ関数の場合
     
    629629    if( isProcedureCallOnly )
    630630    {
    631         SetError(3, termLeft, cp );
     631        compiler.errorMessenger.Output(3, termLeft, cp );
    632632    }
    633633
     
    645645        // 変数の場合はeaxに変数ポインタを格納する
    646646        if( !VarToReg( relativeVar, baseType, resultType ) ){
    647             SetError(11,term,cp);
     647            compiler.errorMessenger.Output(11,term,cp);
    648648        }
    649649    }
     
    658658    if( !isVariable )
    659659    {
    660         SetError();
     660        compiler.errorMessenger.OutputFatalError();
    661661    }
    662662
     
    678678    if( reg != REG_EAX ){
    679679        // TODO: 未実装
    680         SetError();
     680        compiler.errorMessenger.OutputFatalError();
    681681    }
    682682
     
    708708
    709709    if(expression[0]=='\0'){
    710         SetError(1,NULL,cp);
     710        compiler.errorMessenger.Output(1,NULL,cp);
    711711        return false;
    712712    }
     
    863863                        else GetCalcName(idCalc,temp2);
    864864                        sprintf(temporary,"Operator %s",temp2);
    865                         SetError(27,temporary,cp);
     865                        compiler.errorMessenger.Output(27,temporary,cp);
    866866                        goto error;
    867867                    }
     
    892892                    }
    893893                    else{
    894                         SetError(3, term, cp );
     894                        compiler.errorMessenger.Output(3, term, cp );
    895895                        goto error;
    896896                    }
     
    918918                        // 拡張版リテラル文字列(エスケープシーケンス可能)
    919919                        if(!RemoveStringQuotes(term+2)){
    920                             SetError(43,NULL,cp);
     920                            compiler.errorMessenger.Output(43,NULL,cp);
    921921                            goto error;
    922922                        }
     
    928928                        // 通常文字列
    929929                        if(!RemoveStringQuotes(term)){
    930                             SetError(43,NULL,cp);
     930                            compiler.errorMessenger.Output(43,NULL,cp);
    931931                            goto error;
    932932                        }
     
    976976                                }
    977977                            }
    978                             SetError(38,term,cp);
     978                            compiler.errorMessenger.Output(38,term,cp);
    979979
    980980                            goto error;
     
    990990                        if( resultType.GetBasicType() & FLAG_CAST ){
    991991                            // 型名のみ
    992                             SetError();
     992                            compiler.errorMessenger.OutputFatalError();
    993993                        }
    994994                        else{
     
    10871087                        }
    10881088                        else{
    1089                             SetError(300,NULL,cp);
     1089                            compiler.errorMessenger.Output(300,NULL,cp);
    10901090                            goto error;
    10911091                        }
     
    10951095                    //該当する識別子が見当たらないときはエラー扱いにする
    10961096                    bError=1;
    1097                     SetError(3,term,cp);
     1097                    compiler.errorMessenger.Output(3,term,cp);
    10981098                    type_stack[sp]=DEF_DOUBLE;
    10991099                }
     
    12431243                if( PTR_LEVEL( type_stack[sp-1] ) <= 0 ){
    12441244                    //ポインタ型ではないとき
    1245                     SetError( 3, NULL, cp );
     1245                    compiler.errorMessenger.Output( 3, NULL, cp );
    12461246                    goto error;
    12471247                }
     
    12521252
    12531253            default:
    1254                 SetError(300,NULL,cp);
     1254                compiler.errorMessenger.Output(300,NULL,cp);
    12551255                goto error;
    12561256        }
     
    12601260
    12611261    if(sp!=1){
    1262         SetError(1,NULL,cp);
     1262        compiler.errorMessenger.Output(1,NULL,cp);
    12631263        goto error;
    12641264    }
     
    12661266    if(bLiteralCalculation){
    12671267        //右辺値が数値の定数式の場合
    1268         SetError();
     1268        compiler.errorMessenger.OutputFatalError();
    12691269    }
    12701270    else{
  • trunk/ab5.0/abdev/BasicCompiler32/NumOpe_Arithmetic.cpp

    r290 r465  
    999999    int castBasicType = type[sp-1];
    10001000    if((castBasicType&FLAG_CAST)==0){
    1001         SetError(47,NULL,cp);
     1001        compiler.errorMessenger.Output(47,NULL,cp);
    10021002        return 0;
    10031003    }
  • trunk/ab5.0/abdev/BasicCompiler32/NumOpe_Logical.cpp

    r308 r465  
    1515    if(IsRealNumberType(type[sp-2])||IsRealNumberType(type[sp-1])){
    1616        //いずれかの項が実数のとき
    17         SetError(45,"xor",cp);
     17        compiler.errorMessenger.Output(45,"xor",cp);
    1818        return 0;
    1919    }
     
    158158    if(IsRealNumberType(type[sp-2])||IsRealNumberType(type[sp-1])){
    159159        //いずれかの項が実数のとき
    160         SetError(45,"or",cp);
     160        compiler.errorMessenger.Output(45,"or",cp);
    161161        return 0;
    162162    }
     
    301301    if(IsRealNumberType(type[sp-2])||IsRealNumberType(type[sp-1])){
    302302        //いずれかの項が実数のとき
    303         SetError(45,"and",cp);
     303        compiler.errorMessenger.Output(45,"and",cp);
    304304        return 0;
    305305    }
     
    441441    if(IsRealNumberType(type[sp-1])){
    442442        //実数のとき
    443         SetError(45,"Not",cp);
     443        compiler.errorMessenger.Output(45,"Not",cp);
    444444        return 0;
    445445    }
  • trunk/ab5.0/abdev/BasicCompiler32/NumOpe_Relation.cpp

    r248 r465  
    2424        }
    2525        else{
    26             SetError();
     26            compiler.errorMessenger.OutputFatalError();
    2727        }
    2828    }*/
  • trunk/ab5.0/abdev/BasicCompiler32/OperatorProc.cpp

    r448 r465  
    77
    88void FreeTempObject(int reg,const CClass *pobj_c){
    9     if(!IsSafeReg(reg)) SetError(300,NULL,cp);
     9    if(!IsSafeReg(reg)) compiler.errorMessenger.Output(300,NULL,cp);
    1010
    1111    const CMethod *method = pobj_c->GetDestructorMethod();
     
    231231    if(bCalcUseHeap){
    232232        //未解放のインスタンスが存在する旨を示す警告
    233         SetError(-105,NULL,cp);
     233        compiler.errorMessenger.Output(-105,NULL,cp);
    234234    }
    235235
     
    255255
    256256    //エラーを発行
    257     SetError(-1,"キャスト演算子がオーバーロードされていません。",cp);
     257    compiler.errorMessenger.Output(-1,"キャスト演算子がオーバーロードされていません。",cp);
    258258}
    259259void CallIndexerGetterProc( const Type &classType, const char *ObjectName, char *Parameter,Type &resultType, DWORD dwProcFlags ){
  • trunk/ab5.0/abdev/BasicCompiler32/stdafx.h

    r461 r465  
    2222#include <jenga/include/common/File.h>
    2323#include <jenga/include/common/CmdLine.h>
     24#include <jenga/include/common/Path.h>
    2425
    2526#include "../BasicCompiler_Common/common.h"
  • trunk/ab5.0/abdev/BasicCompiler32/x86CodeGenerator.cpp

    r370 r465  
    3030        || mod == MOD_REG ) )
    3131    {
    32         SetError();
     32        compiler.errorMessenger.OutputFatalError();
    3333    }
    3434    if( isPertialSchedule && !( mod == MOD_DISP32 || mod == MOD_BASE_DISP32 ) )
    3535    {
    36         SetError();
     36        compiler.errorMessenger.OutputFatalError();
    3737    }
    3838
     
    972972    if(type==DEF_DOUBLE)        pNativeCode->Put( (char)0xDD );
    973973    else if(type==DEF_SINGLE)   pNativeCode->Put( (char)0xD9 );
    974     else SetError(300,NULL,cp);
     974    else compiler.errorMessenger.Output(300,NULL,cp);
    975975
    976976    if(base_reg==REG_ESP){
     
    993993    if(type==DEF_DOUBLE)        pNativeCode->Put( (char)0xDD );
    994994    else if(type==DEF_SINGLE)   pNativeCode->Put( (char)0xD9 );
    995     else SetError(300,NULL,cp);
     995    else compiler.errorMessenger.Output(300,NULL,cp);
    996996
    997997    //オペコード、レジスタ
     
    10271027    if(type==DEF_DOUBLE)        pNativeCode->Put( (char)0xDD );
    10281028    else if(type==DEF_SINGLE)   pNativeCode->Put( (char)0xD9 );
    1029     else SetError(300,NULL,cp);
     1029    else compiler.errorMessenger.Output(300,NULL,cp);
    10301030
    10311031    int reg=0;
     
    10691069    if(type==DEF_DOUBLE)        pNativeCode->Put( (char)0xDD );
    10701070    else if(type==DEF_SINGLE)   pNativeCode->Put( (char)0xD9 );
    1071     else SetError(300,NULL,cp);
     1071    else compiler.errorMessenger.Output(300,NULL,cp);
    10721072
    10731073    if(base_reg==REG_ESP){
     
    10901090    if(type==DEF_DOUBLE)        pNativeCode->Put( (char)0xDD );
    10911091    else if(type==DEF_SINGLE)   pNativeCode->Put( (char)0xD9 );
    1092     else SetError(300,NULL,cp);
     1092    else compiler.errorMessenger.Output(300,NULL,cp);
    10931093
    10941094    //オペコード、レジスタ
     
    11241124    if(type==DEF_DOUBLE)        pNativeCode->Put( (char)0xDD );
    11251125    else if(type==DEF_SINGLE)   pNativeCode->Put( (char)0xD9 );
    1126     else SetError(300,NULL,cp);
     1126    else compiler.errorMessenger.Output(300,NULL,cp);
    11271127
    11281128    int reg=0;
     
    11821182    }
    11831183    else{
    1184         SetError();
     1184        compiler.errorMessenger.OutputFatalError();
    11851185    }
    11861186}
  • trunk/ab5.0/abdev/BasicCompiler_Common/BasicCompiler.cpp

    r461 r465  
    299299            SendMessage(hwnd,EM_GETSEL,(WPARAM)&pos,0);
    300300            i=(int)SendMessage(hwnd,EM_LINEFROMCHAR,pos,0);
    301             ShowErrorLine(pErrorInfo[i].line,pErrorInfo[i].FileName);
     301            compiler.errorMessenger.ShowErrorLine( i );
    302302
    303303            StartPos=(int)SendMessage(hwnd,EM_LINEINDEX,i,0);
     
    808808    lstrcat(BasicCurDir,temporary);
    809809
    810     //エラーリスト情報を初期化
    811     pErrorInfo=(ERRORINFO *)HeapAlloc(hHeap,0,1);
    812     ErrorNum=0;
    813     CompileMsgNum=0;
    814     WarningNum=0;
    815     bError=0;
    816 
    817810    if(bClipCompileView){
    818811        //ProjectEditor埋め込み型インターフェイス
     
    859852    }
    860853
    861     //エラーリスト情報を解放
    862     for(i=0;i<ErrorNum;i++){
    863         if(pErrorInfo[i].FileName) HeapDefaultFree(pErrorInfo[i].FileName);
    864     }
    865     HeapDefaultFree(pErrorInfo);
    866 
    867854    //不揮発性データを保存
    868855    pobj_nv->save();
  • trunk/ab5.0/abdev/BasicCompiler_Common/BasicCompiler.h

    r459 r465  
    2222DWORD ImageBase;
    2323
    24 ERRORINFO *pErrorInfo;
    25 int ErrorNum;
    26 int CompileMsgNum;
    27 int WarningNum;
    28 BOOL bError;
    2924char **SynonymErrorWords;
    3025int SynonymErrorNum;
  • trunk/ab5.0/abdev/BasicCompiler_Common/CommandFormat.cpp

    r206 r465  
    2828        for(i2=0;;i++,i2++){
    2929            if(Parameter[i]=='\0'){
    30                 SetError(1,NULL,nowLine);
     30                compiler.errorMessenger.Output(1,NULL,nowLine);
    3131                return;
    3232            }
     
    4141        else if(lstrcmpi(temporary,"append")==0) lstrcat(buffer,",3");
    4242        else{
    43             SetError(1,NULL,nowLine);
     43            compiler.errorMessenger.Output(1,NULL,nowLine);
    4444            return;
    4545        }
     
    7777    else{
    7878        if(Parameter[0]!='('){
    79             SetError(10,"Line",nowLine);
     79            compiler.errorMessenger.Output(10,"Line",nowLine);
    8080            return;
    8181        }
     
    9595
    9696        if(Parameter[i+1]!='-'){
    97             SetError(10,"Line",nowLine);
     97            compiler.errorMessenger.Output(10,"Line",nowLine);
    9898            return;
    9999        }
     
    109109
    110110    if(Parameter[i]!='('){
    111         SetError(10,"Line",nowLine);
     111        compiler.errorMessenger.Output(10,"Line",nowLine);
    112112        return;
    113113    }
     
    131131    }
    132132    else if(Parameter[i+1]!=','){
    133         SetError(10,"Line",nowLine);
     133        compiler.errorMessenger.Output(10,"Line",nowLine);
    134134        return;
    135135    }
     
    149149    else if(lstrcmpi(temporary,"bf")==0) lstrcat(buffer,",2");
    150150    else{
    151         SetError(10,"Line",nowLine);
     151        compiler.errorMessenger.Output(10,"Line",nowLine);
    152152        return;
    153153    }
     
    160160    i=GetOneParameter(Parameter,i,temporary);   //第7パラメータ取得
    161161    if(Parameter[i-1]==','){
    162         SetError(10,"Line",nowLine);
     162        compiler.errorMessenger.Output(10,"Line",nowLine);
    163163        return;
    164164    }
     
    174174
    175175    if(Parameter[0]!='('){
    176         SetError(10,"Circle",nowLine);
     176        compiler.errorMessenger.Output(10,"Circle",nowLine);
    177177        return;
    178178    }
     
    191191    i++;
    192192    if(Parameter[i]!=','){
    193         SetError(10,"Circle",nowLine);
     193        compiler.errorMessenger.Output(10,"Circle",nowLine);
    194194        return;
    195195    }
     
    243243    }
    244244    else{
    245         SetError(10,"Circle",nowLine);
     245        compiler.errorMessenger.Output(10,"Circle",nowLine);
    246246        return;
    247247    }
     
    253253        lstrcat(buffer,temporary);
    254254        if(Parameter[i-1]==','){
    255             SetError(10,"Circle",nowLine);
     255            compiler.errorMessenger.Output(10,"Circle",nowLine);
    256256            return;
    257257        }
     
    268268
    269269    if(Parameter[0]!='('){
    270         SetError(10,"PSet",nowLine);
     270        compiler.errorMessenger.Output(10,"PSet",nowLine);
    271271        return;
    272272    }
     
    286286    else if(Parameter[i+1]=='\0') lstrcat(buffer,",7");
    287287    else{
    288         SetError(10,"PSet",nowLine);
     288        compiler.errorMessenger.Output(10,"PSet",nowLine);
    289289        return;
    290290    }
     
    296296
    297297    if(Parameter[0]!='('){
    298         SetError(10,"Paint",nowLine);
     298        compiler.errorMessenger.Output(10,"Paint",nowLine);
    299299        return;
    300300    }
     
    311311    }
    312312    if(Parameter[i+1]!=','){
    313         SetError(10,"Paint",nowLine);
     313        compiler.errorMessenger.Output(10,"Paint",nowLine);
    314314        return;
    315315    }
  • trunk/ab5.0/abdev/BasicCompiler_Common/Compile.cpp

    r461 r465  
    8787        if( !pTypeParameterBaseClassNames )
    8888        {
    89             SetError();
     89            compiler.errorMessenger.OutputFatalError();
    9090        }
    9191        pTypeParameterBaseClassNames->clear();
     
    113113            {
    114114                extern int cp;
    115                 SetError(1,NULL,cp);
     115                compiler.errorMessenger.Output(1,NULL,cp);
    116116            }
    117117            typeParameters.push_back( temporary );
     
    129129                    {
    130130                        extern int cp;
    131                         SetError(1,NULL,cp);
     131                        compiler.errorMessenger.Output(1,NULL,cp);
    132132                    }
    133133                }
     
    150150            {
    151151                extern int cp;
    152                 SetError(1,NULL,cp);
     152                compiler.errorMessenger.Output(1,NULL,cp);
    153153            }
    154154        }
     
    181181            char temporary[64];
    182182            GetDefaultNameFromES( cStatement, temporary );
    183             SetError( 22, temporary, pos );
     183            compiler.errorMessenger.Output( 22, temporary, pos );
    184184            return -1;
    185185        }
     
    247247                if( UserProc::IsLocalAreaCompiling() ){
    248248                    // ローカル領域をコンパイルしているとき
    249                     SetError(65,"TypeDef",cp );
     249                    compiler.errorMessenger.Output(65,"TypeDef",cp );
    250250                }
    251251
     
    256256                if( UserProc::IsLocalAreaCompiling() ){
    257257                    // ローカル領域をコンパイルしているとき
    258                     SetError(65,"Delegate",cp );
     258                    compiler.errorMessenger.Output(65,"Delegate",cp );
    259259                }
    260260
     
    273273                    LexicalScope *pScope = compiler.codeGenerator.lexicalScopes.SearchScope( LexicalScope::SCOPE_TYPE_WHILE );
    274274                    if( !pScope ){
    275                         SetError(12,"Exit While",cp);
     275                        compiler.errorMessenger.Output(12,"Exit While",cp);
    276276                        return;
    277277                    }
     
    283283                    LexicalScope *pScope = compiler.codeGenerator.lexicalScopes.SearchScope( LexicalScope::SCOPE_TYPE_FOR );
    284284                    if( !pScope ){
    285                         SetError(12,"Exit For",cp);
     285                        compiler.errorMessenger.Output(12,"Exit For",cp);
    286286                        return;
    287287                    }
     
    293293                    LexicalScope *pScope = compiler.codeGenerator.lexicalScopes.SearchScope( LexicalScope::SCOPE_TYPE_DO );
    294294                    if( !pScope ){
    295                         SetError(12,"Exit Do",cp);
     295                        compiler.errorMessenger.Output(12,"Exit Do",cp);
    296296                        return;
    297297                    }
     
    331331            case ESC_ENDWITH:
    332332                if(WithInfo.num<=0){
    333                     SetError(12,"End With",cp);
     333                    compiler.errorMessenger.Output(12,"End With",cp);
    334334                    return;
    335335                }
     
    340340                if( UserProc::IsLocalAreaCompiling() ){
    341341                    // ローカル領域をコンパイルしているとき
    342                     SetError(65,"Declare",cp );
     342                    compiler.errorMessenger.Output(65,"Declare",cp );
    343343                }
    344344                break;
     
    349349            case ESC_ENDNAMESPACE:
    350350                if( compiler.GetNamespaceSupporter().GetLivingNamespaceScopes().size() <= 0 ){
    351                     SetError(12,"End Namespace",cp);
     351                    compiler.errorMessenger.Output(12,"End Namespace",cp);
    352352                }
    353353                compiler.GetNamespaceSupporter().GetLivingNamespaceScopes().pop_back();
     
    380380                char temporary[64];
    381381                GetDefaultNameFromES(Command[1],temporary);
    382                 SetError(30,temporary,cp);
     382                compiler.errorMessenger.Output(30,temporary,cp);
    383383                break;
    384384        }
     
    502502                while(!(basbuf[cp]==1&&basbuf[cp+1]==ESC_ENDSUB)){
    503503                    if(basbuf[cp]=='\0'){
    504                         SetError(22,"Sub",i2);
     504                        compiler.errorMessenger.Output(22,"Sub",i2);
    505505                        break;
    506506                    }
     
    516516                while(!(basbuf[cp]==1&&basbuf[cp+1]==ESC_ENDFUNCTION)){
    517517                    if(basbuf[cp]=='\0'){
    518                         SetError(22,"Function",i2);
     518                        compiler.errorMessenger.Output(22,"Function",i2);
    519519                        break;
    520520                    }
     
    530530                while(!(basbuf[cp]==1&&basbuf[cp+1]==ESC_ENDMACRO)){
    531531                    if(basbuf[cp]=='\0'){
    532                         SetError(22,"Macro",i2);
     532                        compiler.errorMessenger.Output(22,"Macro",i2);
    533533                        break;
    534534                    }
     
    544544                while(!(basbuf[cp]==1&&basbuf[cp+1]==ESC_ENDTYPE)){
    545545                    if(basbuf[cp]=='\0'){
    546                         SetError(22,"Type",i2);
     546                        compiler.errorMessenger.Output(22,"Type",i2);
    547547                        break;
    548548                    }
     
    558558                while(!(basbuf[cp]==1&&basbuf[cp+1]==ESC_ENDCLASS)){
    559559                    if(basbuf[cp]=='\0'){
    560                         SetError(22,"Class",i2);
     560                        compiler.errorMessenger.Output(22,"Class",i2);
    561561                        break;
    562562                    }
     
    572572                while(!(basbuf[cp]==1&&basbuf[cp+1]==ESC_ENDINTERFACE)){
    573573                    if(basbuf[cp]=='\0'){
    574                         SetError(22,"Interface",i2);
     574                        compiler.errorMessenger.Output(22,"Interface",i2);
    575575                        break;
    576576                    }
     
    686686                }
    687687                if(Return_Sequence){
    688                     SetError(12,temporary,cp);
     688                    compiler.errorMessenger.Output(12,temporary,cp);
    689689                    break;
    690690                }
     
    703703                                basbuf[cp+1]==ESC_ENUM){
    704704                                GetDefaultNameFromES(basbuf[cp+1],temp3);
    705                                 SetError(12,temp3,cp);
     705                                compiler.errorMessenger.Output(12,temp3,cp);
    706706                            }
    707707                        }
     
    718718                                basbuf[cp+1]==ESC_ENUM)){
    719719                                GetDefaultNameFromES(basbuf[cp+1],temp3);
    720                                 SetError(12,temp3,cp);
     720                                compiler.errorMessenger.Output(12,temp3,cp);
    721721                            }
    722722                        }
     
    774774                switch(Return_Command){
    775775                    case COM_WEND:
    776                         SetError(4,"\"While\" - \"Wend\" ",ScopeStart);
     776                        compiler.errorMessenger.Output(4,"\"While\" - \"Wend\" ",ScopeStart);
    777777                        break;
    778778                    case COM_NEXT:
    779                         SetError(4,"\"For\" - \"Next\" ",ScopeStart);
     779                        compiler.errorMessenger.Output(4,"\"For\" - \"Next\" ",ScopeStart);
    780780                        break;
    781781                    case COM_LOOP:
    782                         SetError(4,"\"Do\" - \"Loop\" ",ScopeStart);
     782                        compiler.errorMessenger.Output(4,"\"Do\" - \"Loop\" ",ScopeStart);
    783783                        break;
    784784                }
    785785                switch(Return_Sequence){
    786786                    case ESC_ENDSUB:
    787                         SetError(4,"\"Sub\" - \"End Sub\" ",ScopeStart);
     787                        compiler.errorMessenger.Output(4,"\"Sub\" - \"End Sub\" ",ScopeStart);
    788788                        break;
    789789                    case ESC_ENDFUNCTION:
    790                         SetError(4,"\"Function\" - \"End Function\" ",ScopeStart);
     790                        compiler.errorMessenger.Output(4,"\"Function\" - \"End Function\" ",ScopeStart);
    791791                        break;
    792792                    case ESC_ENDMACRO:
    793                         SetError(4,"\"Macro\" - \"End Macro\" ",ScopeStart);
     793                        compiler.errorMessenger.Output(4,"\"Macro\" - \"End Macro\" ",ScopeStart);
    794794                        break;
    795795                    case ESC_ENDIF:
    796                         SetError(22,"If",ScopeStart);
     796                        compiler.errorMessenger.Output(22,"If",ScopeStart);
    797797                        break;
    798798                }
  • trunk/ab5.0/abdev/BasicCompiler_Common/Intermediate_Step1.cpp

    r461 r465  
    130130            if(bracket[PareNum]!=0||PareNum<0){
    131131                //"カッコ \'( )\'"
    132                 SetError(4,STRING_PARENTHESIS,i);
     132                compiler.errorMessenger.Output(4,STRING_PARENTHESIS,i);
    133133                return;
    134134            }
     
    138138            if(bracket[PareNum]!=1||PareNum<0){
    139139                //"カッコ \'( )\'"
    140                 SetError(4,STRING_PARENTHESIS,i);
     140                compiler.errorMessenger.Output(4,STRING_PARENTHESIS,i);
    141141                return;
    142142            }
     
    146146
    147147            //"カッコ \'( )\'"
    148             if(PareNum!=0) SetError(4,STRING_PARENTHESIS,i);
    149 
    150             if(IsStr!=0) SetError(5,NULL,i);
     148            if(PareNum!=0) compiler.errorMessenger.Output(4,STRING_PARENTHESIS,i);
     149
     150            if(IsStr!=0) compiler.errorMessenger.Output(5,NULL,i);
    151151            if(buffer[i]=='\0') break;
    152152            PareNum=0;
     
    161161                //全角スペース
    162162                if(buffer[i]==(char)0x81&&buffer[i+1]==(char)0x40)
    163                     SetError(20,NULL,i);
     163                    compiler.errorMessenger.Output(20,NULL,i);
    164164
    165165                //その他の全角文字
    166                 else SetError(8,NULL,i);
     166                else compiler.errorMessenger.Output(8,NULL,i);
    167167                sw=1;
    168168            }
     
    259259                while(basbuf[i2]==' '||basbuf[i2]=='\t') i2++;
    260260                if(basbuf[i2]!='\"'){
    261                     SetError(1,NULL,i2);
     261                    compiler.errorMessenger.Output(1,NULL,i2);
    262262                    return;
    263263                }
     
    317317                while(basbuf[i2]==' '||basbuf[i2]=='\t') i2++;
    318318                if(basbuf[i2]!='\"'){
    319                     SetError(1,NULL,i2);
     319                    compiler.errorMessenger.Output(1,NULL,i2);
    320320                    return;
    321321                }
     
    10211021            while(buffer[i]==' '||buffer[i]=='\t') i++;
    10221022            if(buffer[i]!='('){
    1023                 SetError(1,NULL,i);
     1023                compiler.errorMessenger.Output(1,NULL,i);
    10241024                return;
    10251025            }
     
    10471047            while(buffer[i]==' '||buffer[i]=='\t') i++;
    10481048            if(buffer[i]!='='){
    1049                 SetError(1,NULL,i);
     1049                compiler.errorMessenger.Output(1,NULL,i);
    10501050                break;
    10511051            }
     
    12431243                        if(FuncNum!=0){
    12441244                            if(FuncType==ESC_FUNCTION)
    1245                                 SetError(54,"End Function",FuncPtr);
     1245                                compiler.errorMessenger.Output(54,"End Function",FuncPtr);
    12461246                            else if(FuncType==ESC_SUB)
    1247                                 SetError(54,"End Sub",FuncPtr);
     1247                                compiler.errorMessenger.Output(54,"End Sub",FuncPtr);
    12481248                            else if(FuncType==ESC_MACRO)
    1249                                 SetError(54,"End Macro",FuncPtr);
     1249                                compiler.errorMessenger.Output(54,"End Macro",FuncPtr);
    12501250                            return;
    12511251                        }
     
    12651265                        if(FuncNum!=0||i3!=FuncType){
    12661266                            if(basbuf[i2+1]==ESC_ENDFUNCTION)
    1267                                 SetError(12,"End Function",i2);
     1267                                compiler.errorMessenger.Output(12,"End Function",i2);
    12681268                            else if(basbuf[i2+1]==ESC_ENDSUB)
    1269                                 SetError(12,"End Sub",i2);
     1269                                compiler.errorMessenger.Output(12,"End Sub",i2);
    12701270                            else if(basbuf[i2+1]==ESC_ENDMACRO)
    1271                                 SetError(12,"End Macro",i2);
     1271                                compiler.errorMessenger.Output(12,"End Macro",i2);
    12721272                            return;
    12731273                        }
  • trunk/ab5.0/abdev/BasicCompiler_Common/Intermediate_Step2.cpp

    r461 r465  
    2121        }
    2222        if(!IsVariableChar(buffer[i])){
    23             SetError(1,NULL,i);
     23            compiler.errorMessenger.Output(1,NULL,i);
    2424            break;
    2525        }
     
    2828
    2929    if(buffer[i]=='\0'){
    30         SetError(22,"Enum",cp);
     30        compiler.errorMessenger.Output(22,"Enum",cp);
    3131        return;
    3232    }
     
    5151        if(temporary[0]=='\0'){
    5252            if(buffer[i]=='\0'){
    53                 SetError(22,"Enum",cp);
     53                compiler.errorMessenger.Output(22,"Enum",cp);
    5454                break;
    5555            }
     
    109109        else if( basbuf[i] == 1 && basbuf[i+1] == ESC_ENDNAMESPACE ){
    110110            if( namespaceScopes.size() <= 0 ){
    111                 SetError(12, "End Namespace", i );
     111                compiler.errorMessenger.Output(12, "End Namespace", i );
    112112            }
    113113            else{
  • trunk/ab5.0/abdev/BasicCompiler_Common/MakeExe.cpp

    r461 r465  
    4343    extern HANDLE hHeap;
    4444    extern char *basbuf;
    45     extern int ErrorNum;
    4645    extern BOOL bStopCompile;
    4746    extern HWND hMainDlg;
     
    7170    compiler.GetObjectModule().GetSources().push_back( BasicSource() );
    7271    if( !compiler.GetObjectModule().GetCurrentSource().ReadFile( SourceFileName ) ){
    73         SetError(201,SourceFileName,-1);
     72        compiler.errorMessenger.Output(201,SourceFileName,-1);
    7473        goto EndCompile;
    7574    }
     
    8079    else ImageBase=0x00400000;
    8180
    82     extern BOOL bError;
    83     if(bError||bStopCompile) goto EndCompile;
     81    if( compiler.errorMessenger.HasError() || bStopCompile ) goto EndCompile;
    8482
    8583
     
    8987
    9088    //"最適化中..."
    91     CompileMessage(STRING_COMPILE_OPTIMIZING);
     89    compiler.messenger.Output( STRING_COMPILE_OPTIMIZING );
    9290
    9391    //カッコを相互チェック(ダブルクォートチェックチェックを含む)
    9492    CheckParenthesis(basbuf);
    9593
    96     if(bError||bStopCompile) goto EndCompile;
     94    if( compiler.errorMessenger.HasError() || bStopCompile )
     95    {
     96        goto EndCompile;
     97    }
    9798
    9899    //コンパイルダイアログのプログレスバーを上げる
     
    117118    //CheckPareCommand();
    118119
    119     if(bError||bStopCompile) goto EndCompile;
     120    if( compiler.errorMessenger.HasError() || bStopCompile )
     121    {
     122        goto EndCompile;
     123    }
    120124
    121125    //コンパイルダイアログのプログレスバーを上げる
     
    136140    SynonymErrorWords=0;
    137141
    138     if(bError||bStopCompile){
     142    if( compiler.errorMessenger.HasError() || bStopCompile )
     143    {
    139144        //定数に関する情報を解放
    140145        goto EndCompile;
     
    175180                if( compiler.staticLibraries.back()->Read( coreFilePath ) )
    176181                {
    177                     CompileMessage( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" を読み込みました。").c_str() );
     182                    compiler.messenger.Output( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" を読み込みました。").c_str() );
    178183                }
    179184                else
    180185                {
    181                     CompileMessage( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" ファイルが壊れています。").c_str() );
     186                    compiler.messenger.Output( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" ファイルが壊れています。").c_str() );
    182187                    isSuccessfulLoadStaticLinkLibrary = false;
    183188                }
     
    185190            else
    186191            {
    187                 CompileMessage( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" ファイルが存在しません。").c_str() );
     192                compiler.messenger.Output( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" ファイルが存在しません。").c_str() );
    188193                isSuccessfulLoadStaticLinkLibrary = false;
    189194            }
     
    198203                if( compiler.staticLibraries.back()->Read( filePath ) )
    199204                {
    200                     CompileMessage( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" を読み込みました。").c_str() );
     205                    compiler.messenger.Output( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" を読み込みました。").c_str() );
    201206                }
    202207                else
    203208                {
    204                     CompileMessage( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" ファイルが壊れています。").c_str() );
     209                    compiler.messenger.Output( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" ファイルが壊れています。").c_str() );
    205210                    isSuccessfulLoadStaticLinkLibrary = false;
    206211                }
     
    208213            else
    209214            {
    210                 CompileMessage( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" ファイルが存在しません。").c_str() );
     215                compiler.messenger.Output( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" ファイルが存在しません。").c_str() );
    211216                isSuccessfulLoadStaticLinkLibrary = false;
    212217            }
     
    225230
    226231    //"コンパイル中..."
    227     CompileMessage(STRING_COMPILE_COMPILING);
     232    compiler.messenger.Output(STRING_COMPILE_COMPILING);
    228233
    229234    Compile();
     
    248253
    249254        //"コンパイルはユーザーにより中断されました。"
    250         CompileMessage(STRING_COMPILE_STOP);
     255        compiler.messenger.Output(STRING_COMPILE_STOP);
    251256    }
    252257    else{
    253         extern int CompileMsgNum;
    254258        extern int WarningNum;
    255         if(bError==0){
     259        if( !compiler.errorMessenger.HasError() )
     260        {
    256261            //"コンパイルは正常に完了しました(エラー:%d、警告:%d)"
    257262            sprintf(temp2,
    258263                STRING_COMPILE_SUCCESS,
    259                 ErrorNum-CompileMsgNum-WarningNum,
    260                 WarningNum,
     264                compiler.errorMessenger.GetErrorCount(),
     265                compiler.errorMessenger.GetWarningCount(),
    261266                ((double)(GetTickCount() - beforeTickCount))/1000
    262267            );
    263268        }
    264         else{
     269        else
     270        {
    265271            //"コンパイルは中断されました(エラー:%d、警告:%d)"
    266             sprintf(temp2,STRING_COMPILE_ERROR,ErrorNum-CompileMsgNum-WarningNum,WarningNum);
    267         }
    268 
    269         CompileMessage("");
    270         CompileMessage("-----------------------------------------------------");
    271         CompileMessage(temp2);
     272            sprintf(temp2,STRING_COMPILE_ERROR,
     273                compiler.errorMessenger.GetErrorCount(),
     274                compiler.errorMessenger.GetWarningCount() );
     275        }
     276
     277        compiler.messenger.Output( "" );
     278        compiler.messenger.Output( "-----------------------------------------------------" );
     279        compiler.messenger.Output( temp2 );
    272280    }
    273281
     
    282290int MainThread(DWORD dummy){
    283291    extern BOOL bDebugRun;
    284     extern int bError;
    285292
    286293    if(bDebugRun){
     
    296303
    297304        //デバッグ実行
    298         if(bError==0) DebugProgram();
     305        if( !compiler.errorMessenger.HasError() )
     306        {
     307            DebugProgram();
     308        }
    299309    }
    300310    else{
  • 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    }
  • trunk/ab5.0/abdev/BasicCompiler_Common/Object.cpp

    r331 r465  
    2525    const UserProc *pUserProc = GetMethodHash(ObjectName,type.GetClass().GetName().c_str(),Parameter);
    2626    if(!pUserProc){
    27         if(Parameter[0]) SetError(113,type.GetClass().GetName().c_str(),cp);
     27        if(Parameter[0]) compiler.errorMessenger.Output(113,type.GetClass().GetName().c_str(),cp);
    2828        return;
    2929    }
     
    102102            i+=i2;
    103103            if(expression[i]!='\0'){
    104                 SetError(42,NULL,cp);
     104                compiler.errorMessenger.Output(42,NULL,cp);
    105105                return false;
    106106            }
     
    115115
    116116    if( !compiler.StringToType( typeName, resultType ) ){
    117         SetError(3,typeName,cp);
     117        compiler.errorMessenger.Output(3,typeName,cp);
    118118        return false;
    119119    }
     
    124124        ////////////////////////
    125125
    126         SetError(121,NULL,cp);
     126        compiler.errorMessenger.Output(121,NULL,cp);
    127127        return false;
    128128    }
  • trunk/ab5.0/abdev/BasicCompiler_Common/OldStatement.cpp

    r290 r465  
    4141            if(Parameter[i2+1]==';') lstrcpy(buffer+i2,"? \"");
    4242            else if(Parameter[i2+1]==',') lstrcpy(buffer+i2,"\"");
    43             else SetError(10,"Input",cp);
     43            else compiler.errorMessenger.Output(10,"Input",cp);
    4444            i2+=2;
    4545        }
     
    5757            if(Parameter[i2+1]==';') lstrcpy(buffer+i2,"? \"");
    5858            else if(Parameter[i2+1]==',') lstrcpy(buffer+i2,"\"");
    59             else SetError(10,"Input",cp);
     59            else compiler.errorMessenger.Output(10,"Input",cp);
    6060            i2+=2;
    6161        }
     
    8989        }
    9090        if(temporary[0]=='\0'){
    91             SetError(10,"Input",cp);
     91            compiler.errorMessenger.Output(10,"Input",cp);
    9292            return;
    9393        }
     
    122122    else pUserProc=GetSubHash("INPUT_FromPrompt");
    123123    if(!pUserProc){
    124         SetError(3,"Input",cp);
     124        compiler.errorMessenger.Output(3,"Input",cp);
    125125        return;
    126126    }
     
    189189        }
    190190        if(temporary[0]=='\0'){
    191             SetError(10,"Print",cp);
     191            compiler.errorMessenger.Output(10,"Print",cp);
    192192            return;
    193193        }
     
    224224    else pUserProc=GetSubHash("PRINTUSING_ToPrompt");
    225225    if(!pUserProc){
    226         SetError(3,"Print",cp);
     226        compiler.errorMessenger.Output(3,"Print",cp);
    227227        return;
    228228    }
     
    328328    else pUserProc=GetSubHash("PRINT_ToPrompt");
    329329    if(!pUserProc){
    330         SetError(3,"Print",cp);
     330        compiler.errorMessenger.Output(3,"Print",cp);
    331331        return;
    332332    }
  • trunk/ab5.0/abdev/BasicCompiler_Common/ParamImpl.cpp

    r424 r465  
    4444                    if( buffer[i] == '\0' )
    4545                    {
    46                         SetError();
     46                        compiler.errorMessenger.OutputFatalError();
    4747                        break;
    4848                    }
     
    236236                if( pUserProc ){
    237237                    if( isEnabledReturnType ){
    238                         SetError(52,name,cp);
     238                        compiler.errorMessenger.Output(52,name,cp);
    239239                        return NULL;
    240240                    }
     
    267267                if( pUserProc )
    268268                {
    269                     SetError(52,name,cp);
     269                    compiler.errorMessenger.Output(52,name,cp);
    270270                    return NULL;
    271271                }
     
    278278    if( !pUserProc )
    279279    {
    280         SetError();
     280        compiler.errorMessenger.OutputFatalError();
    281281    }
    282282
     
    318318        if( params.size() == 0 || params[params.size()-1]->GetBasicType()!=DEF_ELLIPSE ){
    319319            //パラメータが多すぎるとき
    320             SetError(10,procName,cp);
     320            compiler.errorMessenger.Output(10,procName,cp);
    321321            return false;
    322322        }
     
    329329
    330330            //パラメータが少なすぎるとき
    331             SetError(10,procName,cp);
     331            compiler.errorMessenger.Output(10,procName,cp);
    332332            return false;
    333333        }
  • trunk/ab5.0/abdev/BasicCompiler_Common/RSrcSection.cpp

    r206 r465  
    108108        hFile=CreateFile(pCursorResourceInfo[i3].FileName,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
    109109        if(hFile==INVALID_HANDLE_VALUE){
    110             SetError(23,pCursorResourceInfo[i3].FileName,-1);
     110            compiler.errorMessenger.Output(23,pCursorResourceInfo[i3].FileName,-1);
    111111            sw=1;
    112112            continue;
     
    127127        hFile=CreateFile(pBitmapResourceInfo[i3].FileName,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
    128128        if(hFile==INVALID_HANDLE_VALUE){
    129             SetError(23,pBitmapResourceInfo[i3].FileName,-1);
     129            compiler.errorMessenger.Output(23,pBitmapResourceInfo[i3].FileName,-1);
    130130            sw=1;
    131131            continue;
     
    138138        hFile=CreateFile(pIconResourceInfo[i3].FileName,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
    139139        if(hFile==INVALID_HANDLE_VALUE){
    140             SetError(23,pIconResourceInfo[i3].FileName,-1);
     140            compiler.errorMessenger.Output(23,pIconResourceInfo[i3].FileName,-1);
    141141            sw=1;
    142142            continue;
     
    645645        hFile=CreateFile(pCursorResourceInfo[i3].FileName,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
    646646        if(hFile==INVALID_HANDLE_VALUE){
    647             SetError(23,pCursorResourceInfo[i3].FileName,-1);
     647            compiler.errorMessenger.Output(23,pCursorResourceInfo[i3].FileName,-1);
    648648            return buffer;
    649649        }
     
    725725        hFile=CreateFile(pBitmapResourceInfo[i3].FileName,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
    726726        if(hFile==INVALID_HANDLE_VALUE){
    727             SetError(23,pBitmapResourceInfo[i3].FileName,-1);
     727            compiler.errorMessenger.Output(23,pBitmapResourceInfo[i3].FileName,-1);
    728728            return buffer;
    729729        }
     
    753753        hFile=CreateFile(pIconResourceInfo[i3].FileName,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
    754754        if(hFile==INVALID_HANDLE_VALUE){
    755             SetError(23,pIconResourceInfo[i3].FileName,-1);
     755            compiler.errorMessenger.Output(23,pIconResourceInfo[i3].FileName,-1);
    756756            return buffer;
    757757        }
     
    839839        hFile=CreateFile(temp2,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
    840840        if(hFile==INVALID_HANDLE_VALUE){
    841             SetError(59,temp2,-1);
     841            compiler.errorMessenger.Output(59,temp2,-1);
    842842            return buffer;
    843843        }
  • trunk/ab5.0/abdev/BasicCompiler_Common/Resource.cpp

    r402 r465  
    5959        }
    6060        if(resultType.IsReal()){
    61             SetError(9,temporary,0);
     61            compiler.errorMessenger.Output(9,temporary,0);
    6262            return;
    6363        }
     
    116116        else{
    117117error:
    118             SetError(17,NULL,0);
     118            compiler.errorMessenger.Output(17,NULL,0);
    119119            return;
    120120        }
     
    124124        if(buffer[i2]=='\0') break;
    125125        else if(buffer[i2]!='\n'){
    126             SetError(17,NULL,0);
     126            compiler.errorMessenger.Output(17,NULL,0);
    127127            return;
    128128        }
  • trunk/ab5.0/abdev/BasicCompiler_Common/StrOperation.cpp

    r402 r465  
    883883    if( calcNames[idCalc] == NULL )
    884884    {
    885         SetError();
     885        compiler.errorMessenger.OutputFatalError();
    886886    }
    887887    lstrcpy( name, calcNames[idCalc] );
     
    901901        }
    902902    }
    903     SetError();
     903    compiler.errorMessenger.OutputFatalError();
    904904    return 0;
    905905}
  • trunk/ab5.0/abdev/BasicCompiler_Common/Subroutine.cpp

    r461 r465  
    372372        else if( source[i] == 1 && source[i+1] == ESC_ENDNAMESPACE ){
    373373            if( namespaceScopes.size() <= 0 ){
    374                 SetError(12, "End Namespace", i );
     374                compiler.errorMessenger.Output(12, "End Namespace", i );
    375375            }
    376376            else{
     
    391391            if( !compiler.GetNamespaceSupporter().ImportsNamespace( temporary ) )
    392392            {
    393                 SetError(64,temporary,cp );
     393                compiler.errorMessenger.Output(64,temporary,cp );
    394394            }
    395395
     
    497497            CompileBufferInProcedure( *pUserProc );
    498498        }
    499         else SetError(300,NULL,cp);
     499        else compiler.errorMessenger.Output(300,NULL,cp);
    500500    }
    501501    else
  • trunk/ab5.0/abdev/BasicCompiler_Common/VariableOpe.cpp

    r461 r465  
    173173    else{
    174174        extern int cp;
    175         SetError(1,NULL,cp);
     175        compiler.errorMessenger.Output(1,NULL,cp);
    176176        return 0;
    177177    }
     
    273273                }
    274274                if(variable[i]=='\"'){
    275                     SetError(1,NULL,cp);
     275                    compiler.errorMessenger.Output(1,NULL,cp);
    276276                    return;
    277277                }
     
    360360                }
    361361                if(buffer[i+1]==cPare_Open){
    362                     SetError(14,buffer,cp);
     362                    compiler.errorMessenger.Output(14,buffer,cp);
    363363                    return 0;
    364364                }
     
    411411
    412412    if(!IsVariableTopChar(name[0])){
    413         SetError(1,NULL,nowLine);
     413        compiler.errorMessenger.Output(1,NULL,nowLine);
    414414        return 0;
    415415    }
     
    417417        if(name[i2]=='\0') break;
    418418        if(!IsVariableChar(name[i2])){
    419             SetError(1,NULL,nowLine);
     419            compiler.errorMessenger.Output(1,NULL,nowLine);
    420420            return 0;
    421421        }
     
    451451    const CMember *pMember = objClass.FindDynamicMember( VarName );
    452452    if( !pMember ){
    453         if(isErrorEnabled) SetError(103,VarName,cp);
     453        if(isErrorEnabled) compiler.errorMessenger.Output(103,VarName,cp);
    454454        return false;
    455455    }
     
    459459        //同一クラスオブジェクトの場合はプライベートアクセスを容認する
    460460        if( pMember->IsNoneAccess() ){
    461             if(isErrorEnabled) SetError(107,VarName,cp);
     461            if(isErrorEnabled) compiler.errorMessenger.Output(107,VarName,cp);
    462462            return false;
    463463        }
     
    466466        if(( bPrivateAccess==0 && pMember->IsPrivate() )||
    467467            pMember->IsNoneAccess() ){
    468             if(isErrorEnabled) SetError(107,VarName,cp);
     468            if(isErrorEnabled) compiler.errorMessenger.Output(107,VarName,cp);
    469469            return false;
    470470        }
    471471        else if( bPrivateAccess==0 && pMember->IsProtected() ){
    472             if(isErrorEnabled) SetError(108,VarName,cp);
     472            if(isErrorEnabled) compiler.errorMessenger.Output(108,VarName,cp);
    473473            return false;
    474474        }
     
    490490    else{
    491491        if(lpPtrOffset[0]){
    492             if(isErrorEnabled) SetError(16,lpszMember,cp);
     492            if(isErrorEnabled) compiler.errorMessenger.Output(16,lpszMember,cp);
    493493            return false;
    494494        }
     
    523523        else{
    524524            //エラー
    525             if(isErrorEnabled) SetError(1,NULL,cp);
     525            if(isErrorEnabled) compiler.errorMessenger.Output(1,NULL,cp);
    526526            return false;
    527527        }
     
    674674
    675675    //変数として見つからなかったとき
    676     if(isErrorEnabled) SetError(3,variable,cp);
     676    if(isErrorEnabled) compiler.errorMessenger.Output(3,variable,cp);
    677677    return false;
    678678
     
    688688    else{
    689689        if(lpPtrOffset[0]){
    690             if(isErrorEnabled) SetError(16,variable,cp);
     690            if(isErrorEnabled) compiler.errorMessenger.Output(16,variable,cp);
    691691            return false;
    692692        }
     
    714714        else{
    715715            //エラー
    716             if(isErrorEnabled) SetError(1,NULL,cp);
     716            if(isErrorEnabled) compiler.errorMessenger.Output(1,NULL,cp);
    717717            return false;
    718718        }
     
    828828            (temporary[2]==ESC_FUNCTION||temporary[2]==ESC_SUB)){
    829829            if(buffer[i]!='('){
    830                 SetError(10,temporary,cp);
     830                compiler.errorMessenger.Output(10,temporary,cp);
    831831                return false;
    832832            }
     
    849849
    850850        if( !compiler.StringToType( temporary, type ) ){
    851             SetError(3,temporary,cp);
     851            compiler.errorMessenger.Output(3,temporary,cp);
    852852            return false;
    853853        }
     
    860860
    861861            if( !type.IsObject() ){
    862                 SetError(112,variable,cp);
     862                compiler.errorMessenger.Output(112,variable,cp);
    863863                return false;
    864864            }
     
    877877            if(i2>=0){
    878878                if(!(variable[i2]=='#'||variable[i2]=='!'||variable[i2]=='%'||variable[i2]=='$'))
    879                     SetError(-103,variable,cp);
     879                    compiler.errorMessenger.Output(-103,variable,cp);
    880880            }
    881881        }
     
    896896    if( InitBuf[0] != '\0' && ConstractParameter[0] != '\0' ){
    897897        //初期値とコンストラクタパラメータが同時に呼び出されているとき
    898         SetError(132, NULL, cp);
     898        compiler.errorMessenger.Output(132, NULL, cp);
    899899    }
    900900
     
    944944    if( compiler.GetObjectModule().meta.GetGlobalVars().DuplicateCheck( Symbol( name ) ) ){
    945945        //2重定義のエラー
    946         SetError(15,name,cp);
     946        compiler.errorMessenger.Output(15,name,cp);
    947947        return;
    948948    }
     
    10241024    if( Parameter[i2] == 1 && Parameter[i2+1] == ESC_BYREF ){
    10251025        //参照型
    1026         SetError();
     1026        compiler.errorMessenger.OutputFatalError();
    10271027        Parameter += 2;
    10281028    }
     
    10671067    //定数と2重定義されていないかを調べる
    10681068    if(compiler.GetObjectModule().meta.GetGlobalConsts().GetBasicType(VarName)){
    1069         SetError(15,VarName,cp);
     1069        compiler.errorMessenger.Output(15,VarName,cp);
    10701070        return;
    10711071    }
     
    10731073    //定数マクロとして定義されている場合
    10741074    if( compiler.GetObjectModule().meta.GetGlobalConstMacros().IsExist( VarName ) ){
    1075         SetError(15,VarName,cp);
     1075        compiler.errorMessenger.Output(15,VarName,cp);
    10761076        return;
    10771077    }
     
    10951095    if(dwFlags&DIMFLAG_STATIC){
    10961096        if( UserProc::IsGlobalAreaCompiling() ){
    1097             SetError(60,NULL,cp);
     1097            compiler.errorMessenger.Output(60,NULL,cp);
    10981098            return;
    10991099        }
  • trunk/ab5.0/abdev/BasicCompiler_Common/calculation.cpp

    r402 r465  
    9898    if(sp==1){
    9999        if(stack[0]){
    100             SetError(9,NULL,cp);
     100            compiler.errorMessenger.Output(9,NULL,cp);
    101101            return;
    102102        }
     
    106106        //文字列演算が可能な演算子
    107107        if((stack[sp-2]&&stack[sp-1]==0)||(stack[sp-2]==0&&stack[sp-1])){
    108             SetError(9,NULL,cp);
     108            compiler.errorMessenger.Output(9,NULL,cp);
    109109            return;
    110110        }
     
    113113        //文字列演算ができない演算子
    114114        if(stack[sp-2]||stack[sp-1]){
    115             SetError(9,NULL,cp);
     115            compiler.errorMessenger.Output(9,NULL,cp);
    116116            return;
    117117        }
     
    180180
    181181    extern int cp;
    182     SetError(300,NULL,cp);
     182    compiler.errorMessenger.Output(300,NULL,cp);
    183183    return 0;
    184184}
     
    253253            else{
    254254                //ゼロ割りエラーを検地
    255                 SetError(56,NULL,cp);
     255                compiler.errorMessenger.Output(56,NULL,cp);
    256256            }
    257257        }
     
    261261            else{
    262262                //ゼロ割りエラーを検地
    263                 SetError(56,NULL,cp);
     263                compiler.errorMessenger.Output(56,NULL,cp);
    264264            }
    265265        }
     
    360360            else{
    361361                //ゼロ割りエラーを検地
    362                 SetError(56,NULL,cp);
     362                compiler.errorMessenger.Output(56,NULL,cp);
    363363            }
    364364        }
     
    489489                        Type tempType;
    490490                        if( !compiler.StringToType( temp2, tempType ) ){
    491                             if(enableerror) SetError(3,temp2,cp);
     491                            if(enableerror) compiler.errorMessenger.Output(3,temp2,cp);
    492492                            return false;
    493493                        }
     
    501501                        if( !pConstMacro )
    502502                        {
    503                             if(enableerror) SetError(3,temporary,cp);
     503                            if(enableerror) compiler.errorMessenger.Output(3,temporary,cp);
    504504                            return false;
    505505                        }
    506506                        if( !pConstMacro->GetCalcBuffer( temp2, Parms ) )
    507507                        {
    508                             if(enableerror) SetError(3,temporary,cp);
     508                            if(enableerror) compiler.errorMessenger.Output(3,temporary,cp);
    509509                            return false;
    510510                        }
     
    685685                            else{
    686686                                //エラー
    687                                 if(enableerror) SetError(300,NULL,cp);
     687                                if(enableerror) compiler.errorMessenger.Output(300,NULL,cp);
    688688                                return 0;
    689689                            }
     
    704704                                }
    705705                                //エラー
    706                                 if(enableerror) SetError(3,Parms,cp);
     706                                if(enableerror) compiler.errorMessenger.Output(3,Parms,cp);
    707707                                return false;
    708708                            }
     
    746746            else{
    747747                if(!(Command[i]=='+'||Command[i]=='-'||(Command[i]==1&&Command[i+1]==ESC_NOT))){
    748                     if(enableerror) SetError(1,NULL,cp);
     748                    if(enableerror) compiler.errorMessenger.Output(1,NULL,cp);
    749749                    return false;
    750750                }
     
    994994                    return -1;
    995995                }
    996                 SetError(57,NULL,cp);
     996                compiler.errorMessenger.Output(57,NULL,cp);
    997997                return DEF_BYTE;
    998998            }
     
    10201020                    return -1;
    10211021                }
    1022                 SetError(58,NULL,cp);
     1022                compiler.errorMessenger.Output(58,NULL,cp);
    10231023                return DEF_BYTE;
    10241024            }
     
    10361036                return -1;
    10371037            }
    1038             SetError(12,"&",cp);
     1038            compiler.errorMessenger.Output(12,"&",cp);
    10391039            return DEF_BYTE;
    10401040        }
     
    10901090                    }
    10911091
    1092                     SetError(3,value,cp);
     1092                    compiler.errorMessenger.Output(3,value,cp);
    10931093                    return DEF_DOUBLE;
    10941094                }
     
    11361136    }
    11371137
    1138     SetError(33,NULL,cp);
     1138    compiler.errorMessenger.Output(33,NULL,cp);
    11391139    return DEF_DOUBLE;
    11401140}
     
    14451445                        (Command[i]==1&&Command[i+1]==ESC_BYVAL)
    14461446                    )){
    1447                         SetError(1,NULL,cp);
     1447                        compiler.errorMessenger.Output(1,NULL,cp);
    14481448                        return 0;
    14491449                }
     
    14611461                i+=i4;
    14621462                if(!i3){
    1463                     SetError(1,NULL,cp);
     1463                    compiler.errorMessenger.Output(1,NULL,cp);
    14641464                    return 0;
    14651465                }
  • trunk/ab5.0/abdev/BasicCompiler_Common/common.h

    r461 r465  
    370370
    371371//error.cpp
    372 void SetError(int ErrorNum,const char *KeyWord,int pos);
    373 void SetError(int ErrorNum,const string &keyWord,int pos);
    374 void SetError();
    375 void CompileMessage(const char *buffer);
    376372bool CheckDifferentType( const Type &varType,const Type &calcType,const char *pszFuncName,const int ParmNum);
    377373
  • trunk/ab5.0/abdev/BasicCompiler_Common/error.cpp

    r459 r465  
    55
    66#include "../BasicCompiler_Common/common.h"
    7 
    8 BOOL GetErrorMsg(int num,const char *KeyWord,char *msg,int pos){
    9     extern HANDLE hHeap;
    10     int i2;
    11     char temporary[64];
    12 
    13     char tempKeyWord[1024];
    14     if(KeyWord){
    15         lstrcpy(tempKeyWord,KeyWord);
    16         for(i2=0;;i2++){
    17             if(tempKeyWord[i2]=='\0') break;
    18             if(tempKeyWord[i2]==1){
    19                 GetDefaultNameFromES(tempKeyWord[i2+1],temporary);
    20                 SlideString(tempKeyWord+i2+2,lstrlen(temporary)-2);
    21                 memcpy(tempKeyWord+i2,temporary,lstrlen(temporary));
    22             }
    23         }
    24     }
    25     else{
    26         lstrcpy(tempKeyWord,"");
    27     }
    28 
    29     if(num==-1||num==-2) lstrcpy(msg,tempKeyWord);  //部分エラー
    30 
    31     if(num==3){
    32         temporary[0]=tempKeyWord[0];
    33         for(i2=1;;i2++){
    34             if((!IsVariableChar(tempKeyWord[i2]))||i2>=255){
    35                 temporary[i2]=0;
    36                 break;
    37             }
    38             temporary[i2]=tempKeyWord[i2];
    39         }
    40 
    41         extern char **SynonymErrorWords;
    42         extern int SynonymErrorNum;
    43         for(i2=0;i2<SynonymErrorNum;i2++){
    44             if(lstrcmp(SynonymErrorWords[i2],temporary)==0) return 0;
    45         }
    46 
    47 #if defined(JPN)
    48         //日本語
    49         sprintf(msg,"\"%s\" 無効な識別子です",temporary);
    50 #else
    51         //英語
    52         sprintf(msg,"\"%s\" Invalid identifier.",temporary);
    53 #endif
    54 
    55         //重複エラー情報を追加
    56         SynonymErrorWords=(char **)HeapReAlloc(hHeap,0,SynonymErrorWords,(SynonymErrorNum+1)*sizeof(char *));
    57         SynonymErrorWords[SynonymErrorNum]=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
    58         lstrcpy(SynonymErrorWords[SynonymErrorNum],temporary);
    59         SynonymErrorNum++;
    60     }
    61     if(num==30){
    62 #if defined(JPN)
    63         //日本語
    64         if(temporary[0]) sprintf(msg,"\"%s\" の使い方が不正です",tempKeyWord);
    65         else lstrcpy(msg,"文法が間違っています");
    66 #else
    67         //英語
    68         if(temporary[0]) sprintf(msg,"How to use the \"%s\" is wrong.",tempKeyWord);
    69         else lstrcpy(msg,"Syntax Error.");
    70 #endif
    71     }
    72 
    73 
    74     /////////////////////
    75     // ワーニングエラー
    76     /////////////////////
    77 #if defined(JPN)
    78     ////////////////////
    79     //日本語
    80     ////////////////////
    81     if(num==-101) sprintf(msg,"[警告] %sに強制変換されています。データが失われる可能性があります。",tempKeyWord);
    82     if(num==-102) sprintf(msg,"[警告] %sに強制変換されています。",tempKeyWord);
    83     if(num==-103) sprintf(msg,"[警告] \"%s\" 型が指定されていません。Double型として扱います。",tempKeyWord);
    84     if(num==-104) sprintf(msg,"[警告] \"%s\" 戻り値の型が指定されていません。Double型として扱います。",tempKeyWord);
    85     if(num==-105) sprintf(msg,"[警告] 一時オブジェクトの解放を行えません。キャスト用オブジェクトを用意してください。",tempKeyWord);
    86     if(num==-106) sprintf(msg,"[警告] DLLファイル \"%s\" が見つかりません。",tempKeyWord);
    87     if(num==-107) sprintf(msg,"[警告] DLL関数 \"%s\" を参照できません。",tempKeyWord);
    88     if(num==-108) lstrcpy(msg,"[警告] Catch節、Finally節を持たない意味のないTryスコープです。");
    89     if(num==-120) sprintf(msg,"[警告] VarPtr関数の引数にオブジェクト インスタンスが指定されました。オブジェクトの先頭アドレスを取得したいときはObjPtr関数に切り替えをお願いします。m(__)m(この警告はVarPtr→ObjPtrへの切り替えが完了したら消します(切り替えは \"適材箇所に限り\" ですので、ご注意ください!))",tempKeyWord);
    90 #else
    91 #endif
    92 
    93 
    94     ///////////////
    95     // 一般エラー
    96     ///////////////
    97 
    98 #if defined(JPN)
    99     ////////////////////
    100     //日本語
    101     ////////////////////
    102     if(num==1) lstrcpy(msg,"文法が間違っています。");
    103     if(num==2) sprintf(msg,"左のオペランドが、左辺値になっていません。");
    104     //num==3は予約されています
    105     if(num==4) sprintf(msg,"%sの相互関係が一致しません。",tempKeyWord);
    106     if(num==5) sprintf(msg,"ダブルクォートの数が一致しません。");
    107     if(num==6) sprintf(msg,"\"%s\" ジャンプ先が不正です。",tempKeyWord);
    108     if(num==7) lstrcpy(msg,"DLL名が長すぎます(拡張子を含め、16文字以下にして下さい)。");
    109     if(num==8) lstrcpy(msg,"コンパイラが認識できない文字コードが含まれています。");
    110     if(num==9) sprintf(msg,"型が違います。");
    111     if(num==10) sprintf(msg,"\"%s\" のパラメータ指定が間違っています。",tempKeyWord);
    112     if(num==11) sprintf(msg,"\"%s\" 型が違います。",tempKeyWord);
    113     if(num==12) sprintf(msg,"%s の使い方が不正です。",tempKeyWord);
    114     if(num==13) sprintf(msg,"\"%s\" を参照できません。",tempKeyWord);
    115     if(num==14) sprintf(msg,"\"%s\" 配列指定が不正です。",tempKeyWord);
    116     if(num==15) sprintf(msg,"\"%s\" はすでに定義されています。",tempKeyWord);
    117     if(num==16) sprintf(msg,"\"%s\" 配列、またはポインタ以外の変数に添え字が指定されています。",tempKeyWord);
    118     if(num==17) sprintf(msg,"リソース データが不正です。");
    119     if(num==18) sprintf(msg,"\"%s\"はポインタ変数型です。文字列演算を指定することはできません。",tempKeyWord);
    120     if(num==19) sprintf(msg,"\"%s\"は値参照型です。ByVal指定することはできません。",tempKeyWord);
    121     if(num==20) lstrcpy(msg,"全角スペースが含まれています(全角スペースはコンパイラが認識できないので、半角スペースまたはタブ文字にしてください)。");
    122     if(num==21) sprintf(msg,"If制御のブロック指定が不正です。");
    123     if(num==22) sprintf(msg,"%s に対する End %s が見つかりません。",tempKeyWord,tempKeyWord);
    124     if(num==23) sprintf(msg,"リソース ファイル \"%s\" の読み込みに失敗。",tempKeyWord);
    125     if(num==24) lstrcpy(msg,"Export指定の関数のパラメータには実体オブジェクトを利用することはできません(BytePtr型などを利用して下さい)。");
    126     if(num==25) sprintf(msg,"DLL関数にオブジェクトを引き渡すことはできません(%s)。",tempKeyWord);
    127     if(num==26) sprintf(msg,"\"%s\" 戻り値の型が指定されていません。",tempKeyWord);
    128     if(num==27) sprintf(msg,"\"%s\" は定義されていません。",tempKeyWord);
    129     if(num==28) sprintf(msg,"構造体パラメータは参照渡しにしてください(%s)。",tempKeyWord);
    130     if(num==29) sprintf(msg,"配列ポインタを要素と同時に引渡すときは、ポインタ参照(ByRef)にしてください。");
    131     //num==30は予約されています
    132     if(num==31) sprintf(msg,"\"%s\" は構造体です(メンバの参照はピリオド \".\" で区切ってください)。",tempKeyWord);
    133     if(num==32) sprintf(msg,"\"%s\" は構造体ポインタです(メンバの参照は \"->\" で区切ってください)。",tempKeyWord);
    134     if(num==33) sprintf(msg,"定数式にリテラル値、または定数以外のものが含まれています。");
    135     if(num==34) sprintf(msg,"定数はモジュールレベルで宣言して下さい。");
    136     if(num==38) sprintf(msg,"\"%s\" 戻り値が存在しないプロシージャです。",tempKeyWord);
    137     if(num==39) sprintf(msg,"\"%s\" はオブジェクトポインタではありません(\"->\" 参照はできません)。",tempKeyWord);
    138     if(num==40) lstrcpy(msg,"DLL関数の戻り値としてオブジェクトを受け取ることはできません。");
    139     if(num==41) lstrcpy(msg,"初期データが不正です。");
    140     if(num==42) lstrcpy(msg,"閉じカッコ \")\" の後に不正な文字が含まれています。");
    141     if(num==43) lstrcpy(msg,"ダブルクォートの後に不正な文字が含まれています。");
    142     if(num==45) sprintf(msg,"実数に対して \"%s\" 演算子は利用できません。",tempKeyWord);
    143     if(num==46) lstrcpy(msg,"配列の添え字に整数以外の値が与えられています。");
    144     if(num==47) lstrcpy(msg,"As演算子の右辺値に型名以外の識別子が指定されています。");
    145     if(num==48) sprintf(msg,"%s演算子に対して型名が指定されています。",tempKeyWord);
    146     if(num==49) lstrcpy(msg,"添え字に整数以外の型が指定されています。");
    147     if(num==50) sprintf(msg,"%sに変換できません。",tempKeyWord);
    148     if(num==51) lstrcpy(msg,"オブジェクト、構造体のアラインメント値は 1, 2, 4, 8, 16 のいずれかでなければなりません。");
    149     if(num==52) sprintf(msg,"\"%s\" オーバーロードを解決できません。",tempKeyWord);
    150     if(num==53) sprintf(msg,"\"%s\" 出力ファイルの書き込みに失敗しました。実行されている可能性があります。",tempKeyWord);
    151     if(num==54) sprintf(msg,"対応する%sが存在しません。",tempKeyWord);
    152     if(num==55) sprintf(msg,"\"%s\" は対応するForステートメントで利用されるカウンタ変数ではありません。",tempKeyWord);
    153     if(num==56) lstrcpy(msg,"ゼロ割りが行われました。");
    154     if(num==57) lstrcpy(msg,"8進数のリテラル表記が不正です。");
    155     if(num==58) lstrcpy(msg,"16進数のリテラル表記が不正です。");
    156     if(num==59) sprintf(msg,"マニフェスト ファイル \"%s\" の読み込みに失敗。",tempKeyWord);
    157     if(num==60) lstrcpy(msg,"Staticステートメントはグローバル領域では使用できません。");
    158     if(num==61) sprintf(msg,"\"%s\" は定数です。書き込みアクセスはできません。",tempKeyWord);
    159     if(num==62) sprintf(msg,"グローバル領域でのReturnは禁止されています。",tempKeyWord);
    160     if(num==63) lstrcpy(msg,"名前空間が正しく閉じられていません。");
    161     if(num==64) sprintf(msg,"\"%s\" 無効な名前空間です。",tempKeyWord);
    162     if(num==65) sprintf(msg,"ローカル領域で%sは使用できません。",tempKeyWord);
    163     if(num==66) sprintf(msg,"%s 要求されている関数ポインタのパラメータまたは戻り値が一致しません。", tempKeyWord );
    164     if(num==67) sprintf(msg,"%s 要求されているデリゲートのパラメータまたは戻り値が一致しません。", tempKeyWord );
    165     if(num==68) sprintf(msg,"\"%s\" 不正な関数名です。", tempKeyWord);
    166     if(num==69) sprintf(msg,"\"%s\" 不正なメソッド名です。", tempKeyWord);
    167     if(num==70) lstrcpy(msg,"一つのTryに対して複数のFinallyを記述できません。");
    168     if(num==71) lstrcpy(msg,"Finallyの後ろにCatchを記述することはできません。");
    169     if(num==72) lstrcpy(msg,"Catchのパラメータの型が指定されていません。");
    170     if(num==73) lstrcpy(msg,"\"%s\" Catchのパラメータの型はクラス型でなければなりません。");
    171     if(num==74) sprintf(msg,"\"%s\" 型として認識できません。",tempKeyWord);
    172 
    173 
    174     //オブジェクト関連
    175     if(num==102) sprintf(msg,"\"%s\" オブジェクトは定義されていません。",tempKeyWord);
    176     if(num==103) sprintf(msg,"\"%s\" メンバは定義されていません。",tempKeyWord);
    177     if(num==104) sprintf(msg,"\"%s\" 参照方法が違います。",tempKeyWord);
    178     if(num==105) sprintf(msg,"\"%s\" 自身のクラスを継承することはできません。",tempKeyWord);
    179     if(num==106) sprintf(msg,"\"%s\" 存在しないクラスです。",tempKeyWord);
    180     if(num==107) sprintf(msg,"Privateメンバ \"%s\" にアクセスすることはできません。",tempKeyWord);
    181     if(num==108) sprintf(msg,"Protectedメンバ \"%s\" にアクセスすることはできません。",tempKeyWord);
    182     if(num==109) sprintf(msg,"Privateメンバ関数 \"%s\" を呼び出すことはできません。",tempKeyWord);
    183     if(num==110) sprintf(msg,"Protectedメンバ関数 \"%s\" を呼び出すことはできません。",tempKeyWord);
    184     if(num==111) lstrcpy(msg,"InheritsはClass定義内の先頭に記述する必要があります。");
    185     if(num==112) sprintf(msg,"\"%s\" はクラス型ではないため、初期パラメータを指定することはできません。",tempKeyWord);
    186     if(num==113) sprintf(msg,"\"%s\" コンストラクタへ渡すパラメータが不正です。",tempKeyWord);
    187     if(num==114) lstrcpy(msg,"デストラクタはパラメータを持てません。");
    188     if(num==115) lstrcpy(msg,"コンストラクタ及びデストラクタは戻り値を持てません。");
    189     //if(num==116) lstrcpy(msg,"コンストラクタ及びデストラクタはパブリックアクセスにしなければなりません。");
    190     if(num==117) lstrcpy(msg,"デストラクタの名前が \"~クラス名\" になっていません。");
    191     if(num==118) lstrcpy(msg,"参照する基底クラスが存在しません。");
    192     if(num==119) sprintf(msg,"\"%s\" メンバは基底クラスで定義されていません。",tempKeyWord);
    193     if(num==120) lstrcpy(msg,"デストラクトするオブジェクトの型が不明です。");
    194     if(num==121) lstrcpy(msg,"New演算子にはクラス以外の型を指定できません。");
    195     if(num==122) lstrcpy(msg,"Delete演算子にポインタ以外の型が指定されています。");
    196     if(num==123) lstrcpy(msg,"ループ継承が行われました。");
    197     if(num==124) lstrcpy(msg,"循環参照が行われました。");
    198     if(num==125) sprintf(msg,"\"%s\" は抽象クラスです。インスタンス化することはできません。",tempKeyWord);
    199     if(num==126) lstrcpy(msg,"オペレータのオーバーロードをクラスの外で行うことはできません。");
    200     if(num==127) lstrcpy(msg,"Override修飾子の指定が無い状況でオーバーライドを行うことはできません。");
    201     if(num==128) lstrcpy(msg,"オーバーライドを行うときはアクセシビリティを同一にしなければなりません。");
    202     if(num==129) sprintf(msg,"静的メンバ \"%s\" は定義されていません。",tempKeyWord);
    203     if(num==130) sprintf(msg,"\"%s\" はオブジェクト定数です。書き込みアクセスはできません。",tempKeyWord);
    204     if(num==131) lstrcpy(msg,"Const定義されたメソッド内でクラスメンバへの書き込みアクセスはできません。");
    205     if(num==132) lstrcpy(msg,"明示的なコンストラクタ呼び出しと初期値の指定を同時に行うことはできません。");
    206     if(num==133) lstrcpy(msg,"Thisに代入はできません。");
    207     if(num==134) lstrcpy( msg,"ObjPtr関数にはオブジェクト インスタンス以外を指定できません。" );
    208     if(num==135) lstrcpy( msg, "クラス以外の型を継承元として指定することはできません。" );
    209     if(num==136) sprintf( msg, "\"%s\" 非仮想関数に対してオーバーライドしようとしました。", tempKeyWord );
    210     if(num==137) lstrcpy(msg,"ImplementsはClass定義内の先頭に記述する必要があります。");
    211     if(num==138) sprintf(msg,"%s はインターフェイスではありません。Implementsできるのはインターフェイスに限ります。",tempKeyWord);
    212     if(num==139) sprintf(msg,"%s はインターフェイスではありません。",tempKeyWord);
    213     if(num==140) lstrcpy(msg,"Align修飾子を構造体以外の型に指定することはできません。");
    214     if(num==141) lstrcpy(msg,"Blittable修飾子をクラス以外の型に指定することはできません。");
    215     if(num==142) lstrcpy(msg,"不正なThis参照です。");
    216 
    217     //Enum関連
    218     if(num==150) sprintf(msg,"\"%s\" 値が定義されていません。",tempKeyWord);
    219     if(num==151) sprintf(msg,"\"%s\" 列挙リストに登録されていません。",tempKeyWord);
    220 
    221     //リンカ
    222     if(num==200) sprintf(msg,"\"%s\" 未解決です (リンク エラー)。",tempKeyWord);
    223     if(num==201) sprintf(msg,"\"%s\" の読み込みに失敗。",tempKeyWord);
    224 
    225     //原因不明
    226     if(num==300) lstrcpy(msg,"内部エラー");
    227 
    228     // ベースライブラリ不整合
    229     if( num == 400 )    sprintf( msg, "\"%s\" が存在しません。標準ライブラリの内容が古い可能性があります。", tempKeyWord );
    230 
    231 #else
    232     ////////////////////
    233     //英語
    234     ////////////////////
    235     if(num==1) lstrcpy(msg,"Syntax Error.");
    236     if(num==2) sprintf(msg,"Left operand must be l-value.");
    237     //num==3は予約されています
    238     if(num==4) sprintf(msg,"Correlation of %s is wrong.",tempKeyWord);
    239     if(num==5) sprintf(msg,"Correlation of double quotes is wrong.");
    240     if(num==6) sprintf(msg,"\"%s\" Label not found.",tempKeyWord);
    241     if(num==7) lstrcpy(msg,"The DLL name is too long. Must be 16 characters or less.");
    242     if(num==8) lstrcpy(msg,"The inaccurate characters are contained.");
    243     if(num==9) sprintf(msg,"Type is wrong.");
    244     if(num==10) sprintf(msg,"\"%s\" Rule of parameter is wrong.",tempKeyWord);
    245     if(num==11) sprintf(msg,"\"%s\" Type is wrong.",tempKeyWord);
    246     if(num==12) sprintf(msg,"\"%s\" Not a valid use.",tempKeyWord);
    247     if(num==13) sprintf(msg,"Cannot refer to \"%s\".",tempKeyWord);
    248     if(num==14) sprintf(msg,"\"%s\" Array argument(s) out of bound.",tempKeyWord);
    249     if(num==15) sprintf(msg,"\"%s\" is already defined.",tempKeyWord);
    250     if(num==16) sprintf(msg,"\"%s\" Argument(s) following variable which is not pointer or array.",tempKeyWord);
    251     if(num==17) sprintf(msg,"Invalid resource data.");
    252     if(num==18) sprintf(msg,"\"%s\" Invalid operation on a pointer variable.",tempKeyWord);
    253     if(num==19) sprintf(msg,"\"%s\" is already to be passed by value. You cannot use \"ByVal\".",tempKeyWord);
    254     if(num==21) sprintf(msg,"Wrong structure of \"If\" block.");
    255     if(num==22) sprintf(msg,"No matching \"End %s\" found for \"%s\".",tempKeyWord,tempKeyWord);
    256     if(num==23) sprintf(msg,"Cannot read the resource file \"%s\".",tempKeyWord);
    257     if(num==24) lstrcpy(msg,"Must not use String type as an argument for exported function. (Use BytePtr type instead.)");
    258     if(num==27) sprintf(msg,"\"%s\" Undefined procedure.",tempKeyWord);
    259     if(num==28) sprintf(msg,"\"%s\" Structure must not be passed by value. (Use \"ByRef\".)",tempKeyWord);
    260     if(num==29) sprintf(msg,"Array must not be passed by value. (Use \"ByRef\".)");
    261     //num==30は予約されています
    262     if(num==31) sprintf(msg,"\"%s\" is a struct. (Use period \".\" to refer to the members.)",tempKeyWord);
    263     if(num==32) sprintf(msg,"\"%s\" is a pointer of struct. (Use arrow \"->\" to refer to the members.)",tempKeyWord);
    264     if(num==33) sprintf(msg,"Constant formula has a thing that is not literal value or constant value.");
    265     if(num==34) sprintf(msg,"Constant formula must be defined in the module level.");
    266     if(num==38) sprintf(msg,"\"%s\" is a procedure without a return value.",tempKeyWord);
    267     if(num==39) sprintf(msg,"\"%s\" is not object pointer. \"->\" is invalid.",tempKeyWord);
    268     if(num==40) lstrcpy(msg,"Cannot set a object to return value.");
    269     if(num==41) lstrcpy(msg,"Init data is wrong.");
    270     if(num==42) lstrcpy(msg,"The inaccurate characters are contained after the closing parenthesis \")\".");
    271     if(num==43) lstrcpy(msg,"The inaccurate characters are contained after the double quote.");
    272 
    273     //オブジェクト関連
    274     if(num==102) sprintf(msg,"\"%s\" The object is not defined.",tempKeyWord);
    275     if(num==103) sprintf(msg,"\"%s\" The member is not defined.",tempKeyWord);
    276     if(num==104) sprintf(msg,"\"%s\" The reference character is different.",tempKeyWord);
    277     if(num==105) sprintf(msg,"\"%s\" An own class is not inheritable.",tempKeyWord);
    278     if(num==106) sprintf(msg,"\"%s\" It class is not defined.",tempKeyWord);
    279     if(num==107) sprintf(msg,"\"%s\" Cannot access the private member.",tempKeyWord);
    280     if(num==108) sprintf(msg,"\"%s\" Cannot access the protected member.",tempKeyWord);
    281     if(num==109) sprintf(msg,"\"%s\" Cannot call the private member.",tempKeyWord);
    282     if(num==110) sprintf(msg,"\"%s\" Cannot call the protected member.",tempKeyWord);
    283     if(num==111) lstrcpy(msg,"The Inherits phrase must be described to the 1st line of class module");
    284     if(num==112) sprintf(msg,"\"%s\" is not class object. Therefor you cannot set the parameter for constructor.",tempKeyWord);
    285     if(num==113) sprintf(msg,"\"%s\" The parameter for constructor is wrong.",tempKeyWord);
    286     if(num==114) lstrcpy(msg,"Destructor cannot have a parameter.");
    287     if(num==115) lstrcpy(msg,"Constructor and Destructor cannot have a return value.");
    288     if(num==116) lstrcpy(msg,"Constructor and Destructor must be public access.");
    289     if(num==117) lstrcpy(msg,"Destructors name must be \"~ClassName\".");
    290     if(num==118) lstrcpy(msg,"Super class is not found.");
    291     if(num==119) sprintf(msg,"\"%s\" The member is not defined in the super class.",tempKeyWord);
    292 
    293     //Enum関連
    294     if(num==150) sprintf(msg,"\"%s\" The value is not set",tempKeyWord);
    295     if(num==151) sprintf(msg,"\"%s\" is not found from enum lists.",tempKeyWord);
    296 
    297     //リンカ
    298     if(num==200) sprintf(msg,"\"%s\" Unknown error.",tempKeyWord);
    299 #endif
    300 
    301     return 1;
    302 }
    303 void SetError(int ErrorNum,const string &keyWord,int pos){
    304     SetError( ErrorNum, keyWord.c_str(), pos );
    305 }
    306 void SetError(int num,const char *KeyWord,int pos){
    307     extern HANDLE hHeap;
    308     extern HWND hMainDlg;
    309     extern ERRORINFO *pErrorInfo;
    310     extern int ErrorNum;
    311     char temporary[1024],temp2[1024],temp3[32];
    312     BOOL bFirst;
    313     int i2;
    314 
    315     extern BOOL bDebugRun;
    316     if(bDebugRun) return;
    317 
    318     if(num!=-2){
    319         //一般エラーまたは警告
    320         i2=0;   //ここにブレークポイントをおく
    321 
    322         if(num>-100){
    323             //エラーのみ
    324 
    325             i2=0;
    326 
    327             if( num == 300 )
    328             {
    329                 // 内部エラー
    330                 i2=0;
    331             }
    332         }
    333 
    334     }
    335 
    336     if(!GetErrorMsg(num,KeyWord,temporary,pos)) return;
    337 
    338     if(ErrorNum==0){
    339         SetDlgItemText(hMainDlg,IDC_ERRORLIST,"");
    340         EnableWindow(GetDlgItem(hMainDlg,IDC_ERRORLIST),1);
    341         bFirst=1;
    342     }
    343     else bFirst=0;
    344 
    345 
    346     ////////////////////
    347     // エラー情報を追加
    348     pErrorInfo=(ERRORINFO *)HeapReAlloc(hHeap,0,pErrorInfo,(ErrorNum+1)*sizeof(ERRORINFO));
    349 
    350     if(pos==-1){
    351         pErrorInfo[ErrorNum].FileName=0;
    352         lstrcpy(temp2,temporary);
    353     }
    354     else{
    355         std::string dummyStr;
    356         compiler.GetObjectModule().GetCurrentSource().GetLineInfo( pos, pErrorInfo[ErrorNum].line, dummyStr );
    357 
    358         pErrorInfo[ErrorNum].FileName=(char *)HeapAlloc(hHeap,0,lstrlen(dummyStr.c_str())+1);
    359         lstrcpy(pErrorInfo[ErrorNum].FileName,dummyStr.c_str());
    360 
    361         _splitpath(pErrorInfo[ErrorNum].FileName,0,0,temp2,temp3);
    362         lstrcat(temp2,temp3);
    363 
    364         if(pErrorInfo[ErrorNum].line==-1)
    365             sprintf(temp2+lstrlen(temp2),"(no area) %s",temporary);
    366         else
    367             sprintf(temp2+lstrlen(temp2),"(%d) - %s",pErrorInfo[ErrorNum].line+1,temporary);
    368     }
    369 
    370     i2=GetWindowTextLength(GetDlgItem(hMainDlg,IDC_ERRORLIST));
    371     SendDlgItemMessage(hMainDlg,IDC_ERRORLIST,EM_SETSEL,i2,i2);
    372     if(bFirst==0){
    373         SendDlgItemMessage(hMainDlg,IDC_ERRORLIST,EM_REPLACESEL,0,(LPARAM)"\r\n");
    374         i2+=2;
    375         SendDlgItemMessage(hMainDlg,IDC_ERRORLIST,EM_SETSEL,i2,i2);
    376     }
    377     SendDlgItemMessage(hMainDlg,IDC_ERRORLIST,EM_REPLACESEL,0,(LPARAM)temp2);
    378 
    379     std::string msg = temp2;
    380     if(num==-2){
    381         //コンパイルメッセージ
    382         //※何もしない
    383         extern int CompileMsgNum;
    384         CompileMsgNum++;
    385     }
    386     else{
    387         msg = (num>-100) ? "error - " : "warning - ";
    388         msg += temp2;
    389         if(num>-100){
    390             //警告ではなく、エラーの場合はエラーチェックフラグを立てる
    391             extern BOOL bError;
    392             bError=1;
    393         }
    394         else{
    395             extern int WarningNum;
    396             WarningNum++;
    397         }
    398 
    399         // ログに出力
    400         trace( msg );
    401     }
    402 
    403     std::cout << msg << endl;
    404 
    405 
    406     ErrorNum++;
    407 }
    408 void SetError(){
    409     SetError(300,NULL,cp);
    410 }
    411 void CompileMessage(const char *buffer){
    412     SetError(-2,buffer,-1);
    413 }
    4147
    4158#define STRING_SYSTEM_DECLAREHANDLE "*_System_DeclareHandle_"
     
    44437
    44538    extern int cp;
    446     if(iWarning==1) SetError(-101,temporary,cp);
    447     else if(iWarning==2) SetError(-102,temporary,cp);
    448     else if(iWarning==3) SetError(50,temporary,cp);
     39    if(iWarning==1) compiler.errorMessenger.Output(-101,temporary,cp);
     40    else if(iWarning==2) compiler.errorMessenger.Output(-102,temporary,cp);
     41    else if(iWarning==3) compiler.errorMessenger.Output(50,temporary,cp);
    44942}
    45043
  • trunk/ab5.0/abdev/BasicCompiler_Common/hash.cpp

    r461 r465  
    125125    if(subs.size() == 0){
    126126        if(bError){
    127             SetError(3,lpszName,cp);
     127            compiler.errorMessenger.Output(3,lpszName,cp);
    128128        }
    129129        return 0;
     
    132132    //一つ以上の関数が存在するときは内部エラー(デバッグ用)
    133133    if(subs.size() > 1){
    134         if(bError) SetError(300,NULL,cp);
     134        if(bError) compiler.errorMessenger.Output(300,NULL,cp);
    135135    }
    136136
     
    169169    char temporary[VN_SIZE];
    170170    sprintf( temporary, "%s.%s", className, methodName );
    171     SetError(3, temporary, -1 );
     171    compiler.errorMessenger.Output(3, temporary, -1 );
    172172
    173173    return NULL;
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/Compiler.h

    r461 r465  
    11#pragma once
    22
     3#include <Messenger.h>
    34#include <CodeGenerator.h>
    45#include <NamespaceSupporter.h>
     
    8586        return namespaceSupporter;
    8687    }
     88
     89    // メッセンジャー
     90    Messenger messenger;
     91    ErrorMessenger errorMessenger;
    8792
    8893    // コード生成機構
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/Method.h

    r382 r465  
    55class UserProc;
    66class CClass;
    7 void SetError();
    87
    98class CMethod : public MemberPrototype
     
    175174    }
    176175
    177     virtual bool Override( const UserProc *pUserProc, Prototype::Accessibility accessibility, bool isOverrideModifier ){SetError();return false;}
    178 
    179     virtual bool IsAbstract() const{SetError();return false;}
    180     virtual void SetAbstractMark( bool isAbstract ){SetError();}
     176    virtual bool Override( const UserProc *pUserProc, Prototype::Accessibility accessibility, bool isOverrideModifier )
     177    {
     178        throw;
     179    }
     180
     181    virtual bool IsAbstract() const
     182    {
     183        throw;
     184    }
     185    virtual void SetAbstractMark( bool isAbstract )
     186    {
     187        throw;
     188    }
    181189    virtual bool IsVirtual() const{
    182190        return false;
    183191    }
    184     virtual bool IsConst() const{SetError();return false;}
     192    virtual bool IsConst() const
     193    {
     194        throw;
     195    }
    185196    virtual bool IsDynamic() const
    186197    {
     
    191202        return true;
    192203    }
    193     virtual const CClass *GetInheritsClassPtr() const{SetError();return NULL;}
    194     virtual void SetInheritsClassPtr( const CClass *pInheritsClass ){SetError();}
     204    virtual const CClass *GetInheritsClassPtr() const
     205    {
     206        throw;
     207    }
     208    virtual void SetInheritsClassPtr( const CClass *pInheritsClass )
     209    {
     210        throw;
     211    }
    195212    virtual bool IsNotUse() const
    196213    {
     
    199216    virtual void SetNotUseMark( bool isNotUse )
    200217    {
    201         SetError();
     218        throw;
    202219    }
    203220};
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/NativeCode.h

    r370 r465  
    119119        return lpValue;
    120120    }
    121     const ::DllProc &GetDllProc() const
    122     {
    123         if( type != Schedule::DllProc )
    124         {
    125             SetError();
    126         }
    127         return *pDllProc;
    128     }
    129     const ::UserProc &GetUserProc() const
    130     {
    131         if( !( type == Schedule::UserProc || type == Schedule::AddressOf || type == Schedule::CatchAddress ) )
    132         {
    133             SetError();
    134         }
    135         return *pUserProc;
    136     }
    137     const ::CClass &GetClass() const
    138     {
    139         if( !( type == Schedule::ComVtbl || type == Schedule::Vtbl || type == Schedule::TypeInfo ) )
    140         {
    141             SetError();
    142         }
    143         return *pClass;
    144     }
    145 
    146     void SpecifyAddressOf()
    147     {
    148         if( type != Schedule::UserProc )
    149         {
    150             SetError();
    151         }
    152         type = Schedule::AddressOf;
    153     }
    154     void SpecifyCatchAddress()
    155     {
    156         if( type != Schedule::UserProc )
    157         {
    158             SetError();
    159         }
    160         type = Schedule::CatchAddress;
    161     }
     121    const ::DllProc &GetDllProc() const;
     122    const ::UserProc &GetUserProc() const;
     123    const ::CClass &GetClass() const;
     124
     125    void SpecifyAddressOf();
     126    void SpecifyCatchAddress();
    162127};
    163128typedef std::vector<Schedule> Schedules;
  • 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
  • trunk/ab5.0/jenga/include/common/String.h

    r298 r465  
    99typedef std::vector<std::string> Strings;
    1010
     11bool IsExistString( const Jenga::Common::Strings &strings, const std::string &findStr );
     12
    1113}
    1214}
  • trunk/ab5.0/jenga/projects/common/common.vcproj

    r323 r465  
    297297                >
    298298            </File>
     299            <File
     300                RelativePath="..\..\src\common\String.cpp"
     301                >
     302            </File>
    299303        </Filter>
    300304        <Filter
Note: See TracChangeset for help on using the changeset viewer.