Ignore:
Timestamp:
Jul 12, 2007, 2:58:26 AM (17 years ago)
Author:
dai_9181
Message:

コード全体のリファクタリングを実施

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abdev/BasicCompiler_Common/NumOpe_GetType.cpp

    r198 r206  
     1#include "stdafx.h"
     2
    13#include <jenga/include/smoothie/Smoothie.h>
    24#include <jenga/include/smoothie/LexicalAnalysis.h>
     
    198200    pobj_c=(CClass *)index_stack[sp-2];
    199201
    200     std::vector<UserProc *> subs;
     202    std::vector<const UserProc *> subs;
    201203    pobj_c->GetMethods().Enum( idCalc, subs );
    202204    if( subs.size() == 0 ){
     
    228230    if(idCalc==CALC_EQUAL) lstrcpy(temporary,"==");
    229231    else GetCalcName(idCalc,temporary);
    230     UserProc *pUserProc = OverloadSolution( temporary, subs, params, baseType );
     232    const UserProc *pUserProc = OverloadSolution( temporary, subs, params, baseType );
    231233
    232234    if(bTwoTerm){
     
    315317    // パース
    316318    char member[VN_SIZE];
    317     CClass::RefType refType;
    318     if( CClass::SplitName( termFull, termLeft, member, refType ) ){
     319    ReferenceKind refType;
     320    if( SplitMemberName( termFull, termLeft, member, refType ) ){
    319321        ///////////////////////////////////////////////////////////////////
    320322        // オブジェクトとメンバに分解できるとき
     
    371373        // 動的メソッドを検索
    372374        ///////////////////////////////////////////////////////////////////
    373         vector<UserProc *> userProcs;
    374 
    375375        char methodName[VN_SIZE] ,lpPtrOffset[VN_SIZE];
    376376        lstrcpy( methodName, member );
    377377        GetVarFormatString(methodName,parameter,lpPtrOffset,member,refType);
    378378
     379        vector<const UserProc *> userProcs;
    379380        objClass.GetMethods().Enum( methodName, userProcs );
    380         UserProc *pUserProc;
    381381        if(userProcs.size()){
    382382            //オーバーロードを解決
    383             pUserProc=OverloadSolutionWithStrParam(termFull,userProcs,parameter,termLeft);
     383            const UserProc *pUserProc = OverloadSolutionWithStrParam(termFull,userProcs,parameter,termLeft);
    384384
    385385            if( pUserProc ){
     
    413413    if(lstrcmpi(termFull,"This")==0){
    414414        //Thisオブジェクト
    415         resultType.SetType( DEF_OBJECT, Smoothie::Temp::pCompilingClass );
     415        resultType.SetType( DEF_OBJECT, compiler.pCompilingClass );
    416416        isLiteral = false;
    417417        return true;
     
    455455            return true;
    456456        }
    457         else if(GetConstCalcBuffer(procName,parameter,temporary)){
    458             /////////////////////////
    459             // マクロ関数
    460             /////////////////////////
    461 
    462             //閉じカッコ")"に続く文字がNULLでないときはエラーにする
    463             if(termFull[i2+1+i4+1]!='\0') SetError(42,NULL,cp);
    464 
    465             //マクロ関数の場合
    466             if( !NumOpe_GetType(temporary,Type(),resultType) ){
    467                 return false;
    468             }
    469 
    470             if( !IS_LITERAL( resultType.GetIndex() ) ){
    471                 //リテラル値ではなかったとき
    472                 isLiteral = false;
    473             }
    474 
    475             return true;
     457        else
     458        {
     459            ConstMacro *pConstMacro = compiler.GetMeta().GetGlobalConstMacros().Find( procName );
     460            if( pConstMacro )
     461            {
     462                if( pConstMacro->GetCalcBuffer( parameter, temporary ) )
     463                {
     464                    /////////////////////////
     465                    // マクロ関数
     466                    /////////////////////////
     467
     468                    //閉じカッコ")"に続く文字がNULLでないときはエラーにする
     469                    if(termFull[i2+1+i4+1]!='\0') SetError(42,NULL,cp);
     470
     471                    //マクロ関数の場合
     472                    if( !NumOpe_GetType(temporary,Type(),resultType) ){
     473                        return false;
     474                    }
     475
     476                    if( !IS_LITERAL( resultType.GetIndex() ) ){
     477                        //リテラル値ではなかったとき
     478                        isLiteral = false;
     479                    }
     480
     481                    return true;
     482                }
     483            }
    476484        }
    477485    }
     
    732740                    //////////////
    733741
    734                     i3 = CDBConst::obj.GetBasicType(term);
     742                    i3 = compiler.GetMeta().GetGlobalConsts().GetBasicType(term);
    735743                    if(i3){
    736                         if( CDBConst::obj.IsStringPtr( term ) ){
     744                        if( compiler.GetMeta().GetGlobalConsts().IsStringPtr( term ) ){
    737745                            //リテラル文字列
    738746                            goto StrLiteral;
Note: See TracChangeset for help on using the changeset viewer.