Changeset 555 in dev


Ignore:
Timestamp:
May 5, 2008, 2:23:49 AM (16 years ago)
Author:
dai_9181
Message:

BasicSource::DirectiveIncludeOrRequire内で発生したエラーのエラー出力を呼び出し元で行うようにした。

Location:
trunk/ab5.0/abdev/BasicCompiler_Common
Files:
4 edited

Legend:

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

    r554 r555  
    7777        goto EndCompile;
    7878    }
     79    if( !compiler.GetObjectModule().GetCurrentSource().cannotIncludePath.empty() )
     80    {
     81        compiler.errorMessenger.Output(
     82            35,
     83            compiler.GetObjectModule().GetCurrentSource().cannotIncludePath,
     84            compiler.GetObjectModule().GetCurrentSource().cannotIncludeSourcePos
     85        );
     86        goto EndCompile;
     87    }
    7988
    8089    //イメージベースの設定
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/Source.h

    r554 r555  
    248248        return buffer[2+index];
    249249    }
     250
     251    std::string cannotIncludePath;
     252    int cannotIncludeSourcePos;
    250253};
    251254typedef std::vector<BasicSource> BasicSources;
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Messenger.cpp

    r541 r555  
    168168    if(errorCode==33) sprintf(msg,"定数式にリテラル値、または定数以外のものが含まれています。");
    169169    if(errorCode==34) sprintf(msg,"定数はモジュールレベルで宣言して下さい。");
     170    if(errorCode==35) sprintf(msg,"インクルードファイル \"%s\" をオープンできません",tempKeyWord);
    170171    if(errorCode==38) sprintf(msg,"\"%s\" 戻り値が存在しないプロシージャです。",tempKeyWord);
    171172    if(errorCode==39) sprintf(msg,"\"%s\" はオブジェクトポインタではありません(\"->\" 参照はできません)。",tempKeyWord);
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Source.cpp

    r554 r555  
    621621            else continue;
    622622
     623            if( !Jenga::Common::Path( temporary ).IsExistFile() )
     624            {
     625                this->cannotIncludePath = temporary;
     626                this->cannotIncludeSourcePos = i;
     627                includedFilesRelation.AddLine( FileLayer[layer] );
     628                break;
     629            }
     630
    623631            if( i == 0 && Jenga::Common::Path(temporary).GetFileName() == "basic" )
    624632            {
     
    655663
    656664                //インクルードファイルを読み込む
    657                 if( !source.ReadFile_InIncludeDirective( temporary ) ){
    658                     sprintf(temp2,"インクルードファイル \"%s\" をオープンできません",temporary);
    659                     compiler.errorMessenger.Output(-1,temp2,i);
    660                     break;
     665                if( !source.ReadFile_InIncludeDirective( temporary ) )
     666                {
     667                    throw;
    661668                }
    662669            }
Note: See TracChangeset for help on using the changeset viewer.