Changeset 89 in dev for BasicCompiler32


Ignore:
Timestamp:
Apr 4, 2007, 2:03:09 AM (17 years ago)
Author:
dai_9181
Message:

実行時型情報の生成に対応。
関数の戻り値の型に抽象クラスを指定できるようにした。

Location:
BasicCompiler32
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler32/BasicCompiler.vcproj

    r88 r89  
    605605                <File
    606606                    RelativePath="..\BasicCompiler_Common\Overload.cpp"
    607                     >
    608                     <FileConfiguration
    609                         Name="Debug|Win32"
    610                         >
    611                         <Tool
    612                             Name="VCCLCompilerTool"
    613                             PreprocessorDefinitions=""
    614                         />
    615                     </FileConfiguration>
    616                     <FileConfiguration
    617                         Name="Release|Win32"
    618                         >
    619                         <Tool
    620                             Name="VCCLCompilerTool"
    621                             PreprocessorDefinitions=""
    622                         />
    623                     </FileConfiguration>
    624                     <FileConfiguration
    625                         Name="English_Rel|Win32"
    626                         >
    627                         <Tool
    628                             Name="VCCLCompilerTool"
    629                             PreprocessorDefinitions=""
    630                         />
    631                     </FileConfiguration>
    632                 </File>
    633                 <File
    634                     RelativePath="..\BasicCompiler_Common\preprocessor.cpp"
    635607                    >
    636608                    <FileConfiguration
  • BasicCompiler32/Compile_ProcOp.cpp

    r86 r89  
    204204        obp+=31;
    205205    }
    206     else if( userProc.GetName() == "InitializeUserTypes" ){
     206    else if( userProc.GetName() == "InitializeUserTypes"
     207        && userProc.HasParentClass()
     208        && (string)userProc.GetParentClass().name == "_System_TypeBase" ){
     209
     210            pobj_DBClass->Compile_System_InitializeUserTypes();
    207211    }
    208212    else{
     
    243247    pUserProc->beginOpAddress=obp;
    244248
     249    //コンパイル中の関数が属するクラス
     250    pobj_CompilingClass=pUserProc->GetParentClassPtr();
     251
     252    //コンパイルスタートをクラス管理クラスに追加
     253    pobj_DBClass->StartCompile( pUserProc );
     254
     255    //コンパイル中の関数
     256    UserProc::CompileStartForUserProc( pUserProc );
     257
    245258    if(pUserProc->IsSystem()){
     259        ////////////////////
     260        // 特殊関数
     261        ////////////////////
     262
    246263        extern int AllLocalVarSize;
    247264        AllLocalVarSize=0;
     
    313330    AllLocalVarSize+=sizeof(long);
    314331
    315     //コンパイル中の関数が属するクラス
    316     pobj_CompilingClass=pUserProc->GetParentClassPtr();
    317 
    318     //コンパイルスタートをクラス管理クラスに追加
    319     pobj_DBClass->StartCompile( pUserProc );
    320 
    321     //コンパイル中の関数
    322     UserProc::CompileStartForUserProc( pUserProc );
    323 
    324332
    325333    ///////////////////////
     
    358366        }
    359367        else{
    360             //戻り値用の変数の定義
    361             sprintf(temporary,"%s%c%c%s",temp,1,ESC_AS, pUserProc->ReturnType().ToString().c_str() );
     368            if( pUserProc->ReturnType().IsObject() ){
     369                sprintf(temporary,"%s=Nothing%c%c%s",temp,1,ESC_AS, pUserProc->ReturnType().ToString().c_str() );
     370            }
     371            else{
     372                //戻り値用の変数の定義
     373                sprintf(temporary,"%s%c%c%s",temp,1,ESC_AS, pUserProc->ReturnType().ToString().c_str() );
     374            }
    362375
    363376            OpcodeDim(temporary,0);
     
    464477                    RemoveStringPare(temporary);
    465478
    466                     Opcode_CallProc(temporary,
    467                         pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod()->pUserProc,
    468                         0,
    469                         "",
    470                         0);
     479                    Type dummyType;
     480                    CallProc( PROC_DEFAULT
     481                        , pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod()->pUserProc
     482                        , pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod()->pUserProc->GetName().c_str()
     483                        , temporary
     484                        , dummyType );
    471485                }
    472486                else{
  • BasicCompiler32/Compile_Var.cpp

    r79 r89  
    12191219    }
    12201220
     1221    /*
     1222    TODO: 消す
     1223    変数は抽象クラスでもOK
    12211224    if( type.IsObject() ){
    12221225        if( type.GetClass().IsAbstract() ){
     
    12251228        }
    12261229    }
     1230    */
    12271231}
    12281232
Note: See TracChangeset for help on using the changeset viewer.