Changeset 71 in dev


Ignore:
Timestamp:
Mar 15, 2007, 5:00:34 AM (17 years ago)
Author:
dai_9181
Message:

Parameter.cpp→ParamImpl.cpp
CParameter→ParamImpl

Type.cpp、Type.hを用意した。

Files:
3 added
12 edited
1 moved

Legend:

Unmodified
Added
Removed
  • BasicCompiler32/BasicCompiler.vcproj

    r67 r71  
    10481048                </Filter>
    10491049                <Filter
    1050                     Name="Class"
     1050                    Name="Type"
    10511051                    >
    10521052                    <File
     
    11121112                    <File
    11131113                        RelativePath="..\BasicCompiler_Common\Enum.h"
     1114                        >
     1115                    </File>
     1116                    <File
     1117                        RelativePath="..\BasicCompiler_Common\Type.h"
    11141118                        >
    11151119                    </File>
     
    12751279                    >
    12761280                    <File
    1277                         RelativePath="..\BasicCompiler_Common\Parameter.cpp"
     1281                        RelativePath="..\BasicCompiler_Common\Parameter.h"
     1282                        >
     1283                    </File>
     1284                    <File
     1285                        RelativePath="..\BasicCompiler_Common\ParamImpl.cpp"
    12781286                        >
    12791287                    </File>
  • BasicCompiler32/CParameter.cpp

    r67 r71  
    22#include "opcode.h"
    33
    4 int CParameter::NewTempParameters( const char *FuncName,PARAMETER_INFO *ppi,int pi_num,int SecondParmNum ){
     4int ParamImpl::NewTempParameters( const char *FuncName,PARAMETER_INFO *ppi,int pi_num,int SecondParmNum ){
    55    ///////////////////////////////////////////////////////
    66    // 一時オブジェクトをあらかじめスタックに積んでおく
     
    9797}
    9898
    99 void CParameter::DeleteTempParameters(){
     99void ParamImpl::DeleteTempParameters(){
    100100    ///////////////////////////////////////////////////////
    101101    // 一時オブジェクトを破棄
     
    131131}
    132132
    133 void CParameter::SetStructParameter(CClass *pobj_Class,LPSTR Parameter){
     133void ParamImpl::SetStructParameter(CClass *pobj_Class,LPSTR Parameter){
    134134    int object_size = pobj_Class->GetSize();
    135135
     
    219219}
    220220
    221 int CParameter::SetParameter(const char *FuncName,PARAMETER_INFO *ppi,int pi_num,int SecondParmNum){
     221int ParamImpl::SetParameter(const char *FuncName,PARAMETER_INFO *ppi,int pi_num,int SecondParmNum){
    222222    ///////////////////////////////////////////////////////////
    223223    // パラメータをレジスタ及びスタックフレームにセット
  • BasicCompiler32/Compile_CallProc.cpp

    r67 r71  
    4848
    4949    //パラメータオブジェクトを生成
    50     CParameter *pobj_parameter=0;
    51     pobj_parameter=new CParameter(Parameter);
     50    ParamImpl *pobj_parameter=0;
     51    pobj_parameter=new ParamImpl(Parameter);
    5252
    5353    //エラーチェック
     
    226226
    227227    //パラメータオブジェクトを生成
    228     CParameter *pobj_parameter=0;
    229     pobj_parameter=new CParameter(temporary);
     228    ParamImpl *pobj_parameter=0;
     229    pobj_parameter=new ParamImpl(temporary);
    230230
    231231    //エラーチェック
     
    372372
    373373    //パラメータオブジェクトを生成
    374     CParameter *pobj_parameter=0;
    375     pobj_parameter=new CParameter(Parameter);
     374    ParamImpl *pobj_parameter=0;
     375    pobj_parameter=new ParamImpl(Parameter);
    376376
    377377    //エラーチェック
  • BasicCompiler32/Opcode.h

    r67 r71  
    192192void SetVarPtrToEax(RELATIVE_VAR *pRelativeVar);
    193193
    194 //CParameter.cpp
     194//ParamImpl.cpp
    195195#define OVERLOAD_MIN_LEVEL 0
    196196#define OVERLOAD_MAX_LEVEL 3
     
    199199#define OVERLOAD_LEVEL2 2
    200200#define OVERLOAD_LEVEL3 3
    201 class CParameter{
     201class ParamImpl{
    202202    char *Parms[255];
    203203    TYPEINFO types[255];
     
    212212
    213213public:
    214     CParameter(const char *buffer);
    215     CParameter(const PARAMETER_INFO *pParamInfo, const int ParmNum);
    216     ~CParameter();
     214    ParamImpl(const char *buffer);
     215    ParamImpl(const PARAMETER_INFO *pParamInfo, const int ParmNum);
     216    ~ParamImpl();
    217217    void SetReturnType(TYPEINFO *pTypeInfo);
    218218
  • BasicCompiler64/BasicCompiler.vcproj

    r56 r71  
    469469                </File>
    470470            </Filter>
     471            <Filter
     472                Name="Common Classes"
     473                >
     474                <File
     475                    RelativePath="..\BasicCompiler_Common\Type.h"
     476                    >
     477                </File>
     478            </Filter>
    471479        </Filter>
    472480        <Filter
     
    14551463                </Filter>
    14561464                <Filter
    1457                     Name="Class"
     1465                    Name="Type"
    14581466                    >
    14591467                    <File
     
    15351543                </Filter>
    15361544                <Filter
    1537                     Name="NativeCode"
    1538                     >
    1539                     <File
    1540                         RelativePath="..\BasicCompiler_Common\NativeCode.cpp"
    1541                         >
    1542                     </File>
    1543                     <File
    1544                         RelativePath="..\BasicCompiler_Common\NativeCode.h"
     1545                    Name="Procedure"
     1546                    >
     1547                    <File
     1548                        RelativePath="..\BasicCompiler_Common\Parameter.h"
     1549                        >
     1550                    </File>
     1551                    <File
     1552                        RelativePath="..\BasicCompiler_Common\ParamImpl.cpp"
     1553                        >
     1554                    </File>
     1555                    <File
     1556                        RelativePath="..\BasicCompiler_Common\Subroutine.cpp"
    15451557                        >
    15461558                    </File>
    15471559                </Filter>
    1548                 <Filter
    1549                     Name="Procedure"
    1550                     >
    1551                     <File
    1552                         RelativePath="..\BasicCompiler_Common\Parameter.cpp"
    1553                         >
    1554                     </File>
    1555                     <File
    1556                         RelativePath="..\BasicCompiler_Common\Subroutine.cpp"
    1557                         >
    1558                     </File>
    1559                 </Filter>
     1560            </Filter>
     1561            <Filter
     1562                Name="CommonClasses"
     1563                >
     1564                <File
     1565                    RelativePath="..\BasicCompiler_Common\Type.cpp"
     1566                    >
     1567                </File>
    15601568            </Filter>
    15611569        </Filter>
  • BasicCompiler64/CParameter.cpp

    r66 r71  
    22#include "opcode.h"
    33
    4 int CParameter::NewTempParameters( const char *FuncName,PARAMETER_INFO *ppi,int pi_num,int SecondParmNum ){
     4int ParamImpl::NewTempParameters( const char *FuncName,PARAMETER_INFO *ppi,int pi_num,int SecondParmNum ){
    55    ///////////////////////////////////////////////////////
    66    // 一時オブジェクトをあらかじめスタックに積んでおく
     
    9696    return stackItemNum * PTR_SIZE;
    9797}
    98 void CParameter::DeleteTempParameters(){
     98void ParamImpl::DeleteTempParameters(){
    9999    ///////////////////////////////////////////////////////
    100100    // 一時オブジェクトを破棄
     
    123123}
    124124
    125 void CParameter::SetStructParameter(int reg,CClass *pobj_Class,LPSTR Parameter){
     125void ParamImpl::SetStructParameter(int reg,CClass *pobj_Class,LPSTR Parameter){
    126126    //////////////////////////////////////////////////////
    127127    /////    レジスタ資源のバックアップ
     
    225225
    226226
    227 void CParameter::SetParameter(const char *FuncName,PARAMETER_INFO *ppi,int pi_num,int SecondParmNum){
     227void ParamImpl::SetParameter(const char *FuncName,PARAMETER_INFO *ppi,int pi_num,int SecondParmNum){
    228228    ///////////////////////////////////////////////////////////
    229229    // パラメータをレジスタ及びスタックフレームにセット
     
    496496    pobj_sf->parameter_allocate(pi_num*sizeof(_int64)+   sizeof(_int64)/*ret用*/  );
    497497}
    498 void CParameter::BackupParameter(int pi_num){
     498void ParamImpl::BackupParameter(int pi_num){
    499499    ///////////////////////////////////////////////////////////
    500500    // スタックフレームに存在する既存のパラメータをバックアップ
     
    523523    }
    524524}
    525 void CParameter::RestoreParameter(int pi_num){
     525void ParamImpl::RestoreParameter(int pi_num){
    526526    ///////////////////////////////////////////////////////////
    527527    // スタックフレームに存在する既存のパラメータを復元
  • BasicCompiler64/Compile_CallProc.cpp

    r64 r71  
    4848
    4949    //パラメータオブジェクトを生成
    50     CParameter *pobj_parameter=0;
    51     pobj_parameter=new CParameter(Parameter);
     50    ParamImpl *pobj_parameter=0;
     51    pobj_parameter=new ParamImpl(Parameter);
    5252
    5353    //エラーチェック
     
    230230
    231231    //パラメータオブジェクトを生成
    232     CParameter *pobj_parameter=0;
    233     pobj_parameter=new CParameter(temporary);
     232    ParamImpl *pobj_parameter=0;
     233    pobj_parameter=new ParamImpl(temporary);
    234234
    235235    //エラーチェック
     
    403403
    404404    //パラメータオブジェクトを生成
    405     CParameter *pobj_parameter=0;
    406     pobj_parameter=new CParameter(Parameter);
     405    ParamImpl *pobj_parameter=0;
     406    pobj_parameter=new ParamImpl(Parameter);
    407407
    408408    //エラーチェック
  • BasicCompiler64/Opcode.h

    r66 r71  
    324324void SetVarPtrToReg(int reg,RELATIVE_VAR *pRelativeVar);
    325325
    326 //CParameter.cpp
     326//ParamImpl.cpp
    327327#define OVERLOAD_MIN_LEVEL 0
    328328#define OVERLOAD_MAX_LEVEL 3
     
    331331#define OVERLOAD_LEVEL2 2
    332332#define OVERLOAD_LEVEL3 3
    333 class CParameter{
     333class ParamImpl{
    334334    char *Parms[255];
    335335    TYPEINFO types[255];
     
    344344
    345345public:
    346     CParameter(const char *buffer);
    347     CParameter(const PARAMETER_INFO *pParamInfo, const int ParmNum);
    348     ~CParameter();
     346    ParamImpl(const char *buffer);
     347    ParamImpl(const PARAMETER_INFO *pParamInfo, const int ParmNum);
     348    ~ParamImpl();
    349349    void SetReturnType(TYPEINFO *pTypeInfo);
    350350
  • BasicCompiler_Common/Class.cpp

    r68 r71  
    389389}
    390390
    391 //デフォルト コピーコンストラクタ メソッドを取得
    392 CMethod *CClass::GetCopyConstructorMethod() const
    393 {
    394     if( CopyConstructorMemberSubIndex == -1 ) return NULL;
    395     return methods[CopyConstructorMemberSubIndex];
    396 }
    397 
    398391//デストラクタ メソッドを取得
    399392CMethod *CClass::GetDestructorMethod() const
     
    858851        if(psi->ParmNum==0) fConstructor=1;
    859852
    860         // TODO: 消す
    861         //コピーコンストラクタ
    862         if(psi->ParmNum==1){
    863             if(psi->pParmInfo[0].type==DEF_OBJECT&&
    864                 psi->pParmInfo[0].u.pobj_c==pobj_c) fConstructor=2;
    865         }
    866 
    867853        //強制的にConst修飾子をつける
    868854        isConst = true;
     
    888874    if( fConstructor == 1 )
    889875        pobj_c->ConstructorMemberSubIndex = (int)pobj_c->methods.size();
    890     else if( fConstructor == 2 )
    891         pobj_c->CopyConstructorMemberSubIndex = (int)pobj_c->methods.size();
    892876    else if( bDestructor )
    893877        pobj_c->DestructorMemberSubIndex = (int)pobj_c->methods.size();
     
    10321016
    10331017            pobj_c->ConstructorMemberSubIndex=-1;
    1034             pobj_c->CopyConstructorMemberSubIndex=-1;
    10351018            pobj_c->DestructorMemberSubIndex=-1;
    10361019
     
    11881171
    11891172            pobj_c->ConstructorMemberSubIndex=-1;
    1190             pobj_c->CopyConstructorMemberSubIndex=-1;
    11911173            pobj_c->DestructorMemberSubIndex=-1;
    11921174
  • BasicCompiler_Common/Class.h

    r67 r71  
    7373    std::vector<CMethod *> methods;
    7474    int ConstructorMemberSubIndex;
    75     int CopyConstructorMemberSubIndex;
    7675    int DestructorMemberSubIndex;
    7776
     
    139138    //デフォルト コンストラクタ メソッドを取得
    140139    CMethod *GetConstructorMethod() const;
    141 
    142     //デフォルト コピーコンストラクタ メソッドを取得
    143     CMethod *GetCopyConstructorMethod() const;
    144140
    145141    //デストラクタ メソッドを取得
  • BasicCompiler_Common/Overload.cpp

    r64 r71  
    2424        ////////////////////////
    2525
    26         CParameter *pobj_parameter=0;
     26        ParamImpl *pobj_parameter=0;
    2727
    2828        char MethodName[VN_SIZE];
     
    3737*/
    3838        //パラメータオブジェクトを生成
    39         pobj_parameter=new CParameter(Parameter);
     39        pobj_parameter=new ParamImpl(Parameter);
    4040        if(pReturnTypeInfo) pobj_parameter->SetReturnType(pReturnTypeInfo);
    4141
     
    6565
    6666
    67         CParameter *pobj_Parameter=new CParameter(ppi,ParmNum);
     67        ParamImpl *pobj_Parameter=new ParamImpl(ppi,ParmNum);
    6868        if(pReturnTypeInfo) pobj_Parameter->SetReturnType(pReturnTypeInfo);
    6969
  • BasicCompiler_Common/ParamImpl.cpp

    r70 r71  
    77#endif
    88
    9 CParameter::CParameter(const char *buffer){
     9ParamImpl::ParamImpl(const char *buffer){
    1010    ///////////////////////////
    1111    // パラメータ文字列を整理
     
    6161    ReturnTypeInfo.u.lpIndex=-1;
    6262}
    63 CParameter::CParameter(const PARAMETER_INFO *pParamInfo,const int ParmNum){
     63ParamImpl::ParamImpl(const PARAMETER_INFO *pParamInfo,const int ParmNum){
    6464    int i;
    6565    for(i=0;i<ParmNum;i++){
     
    7373    ReturnTypeInfo.u.lpIndex=-1;
    7474}
    75 CParameter::~CParameter(){
     75ParamImpl::~ParamImpl(){
    7676    int i2;
    7777
     
    8484}
    8585
    86 void CParameter::SetReturnType(TYPEINFO *pTypeInfo){
     86void ParamImpl::SetReturnType(TYPEINFO *pTypeInfo){
    8787    ReturnTypeInfo=*pTypeInfo;
    8888}
    8989
    90 BOOL CParameter::_overload_check(PARAMETER_INFO *ppi,int pi_num,TYPEINFO *pReturnTypeInfo,int overload_level){
     90BOOL ParamImpl::_overload_check(PARAMETER_INFO *ppi,int pi_num,TYPEINFO *pReturnTypeInfo,int overload_level){
    9191    //パラメータを識別してオーバーロードを解決
    9292
     
    143143}
    144144
    145 SUBINFO *CParameter::OverloadSolutionWithReturnType( const char *name, std::vector<SUBINFO *> &subs ){
     145SUBINFO *ParamImpl::OverloadSolutionWithReturnType( const char *name, std::vector<SUBINFO *> &subs ){
    146146    int sw=0;
    147147    SUBINFO *psi;
     
    178178    return psi;
    179179}
    180 SUBINFO *CParameter::OverloadSolution( const char *name, std::vector<SUBINFO *> &subs ){
     180SUBINFO *ParamImpl::OverloadSolution( const char *name, std::vector<SUBINFO *> &subs ){
    181181    int sw=0;
    182182    SUBINFO *psi;
     
    226226}
    227227
    228 BOOL CParameter::ErrorCheck(const char *FuncName,PARAMETER_INFO *ppi,int pi_num,int SecondParmNum){
     228BOOL ParamImpl::ErrorCheck(const char *FuncName,PARAMETER_INFO *ppi,int pi_num,int SecondParmNum){
    229229    if(ParmsNum>pi_num){
    230230        if(ppi[pi_num-1].type!=DEF_ELLIPSE){
     
    259259}
    260260
    261 void CParameter::MacroParameterSupport(PARAMETER_INFO *ppi){
     261void ParamImpl::MacroParameterSupport(PARAMETER_INFO *ppi){
    262262    int i;
    263263    for(i=0;i<ParmsNum;i++){
  • BasicCompiler_Common/common.h

    r70 r71  
    1111#include <shlobj.h>
    1212#include <vector>
     13#include <string>
    1314
    1415//boost libraries
     
    1617
    1718#define foreach BOOST_FOREACH
     19
     20using namespace std;
    1821
    1922#ifdef _AMD64_
     
    140143
    141144
    142 //クラス管理用のクラス
     145// クラス管理用のクラス
    143146#include "Class.h"
    144147
    145 //列挙体管理用のクラス
     148// 列挙体管理用のクラス
    146149#include "Enum.h"
    147150
    148 //定数管理用のクラス
     151// 定数管理用のクラス
    149152#include "Const.h"
     153
     154// パラメータ管理用のクラス
     155#include "Parameter.h"
     156
    150157
    151158
     
    209216};
    210217
    211 //パラメータ
    212218struct PARAMETER_INFO{
    213219    char *name;
     
    244250    int RealParmNum;
    245251    int RealSecondParmNum;
     252
     253    /*
     254    //パラメータ
     255    Parameters params;
     256    int SecondParmNum;
     257    Parameters realParams;
     258    int RealSecondParmNum;*/
    246259
    247260    //戻り値
Note: See TracChangeset for help on using the changeset viewer.