Changeset 97 in dev for BasicCompiler32/NumOpe.cpp


Ignore:
Timestamp:
Apr 16, 2007, 3:52:40 AM (17 years ago)
Author:
dai_9181
Message:

関数の戻り値オブジェクトのメンバ・メソッドを一時オブジェクトを介さずに参照できるようにした。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler32/NumOpe.cpp

    r94 r97  
    8383}
    8484
    85 
     85void ExtendRegToBigType( int reg, int bigBasicType, int baseBasicType ){
     86    if( reg != REG_EAX ){
     87        SetError();
     88    }
     89    switch( Type::GetBasicSize( bigBasicType ) ){
     90        case sizeof(_int64):
     91            ExtendTypeTo64(baseBasicType);
     92            break;
     93        case sizeof(long):
     94            ExtendTypeTo32(baseBasicType,reg);
     95            break;
     96        case sizeof(short):
     97            ExtendTypeTo16(baseBasicType,reg);
     98            break;
     99    }
     100}
     101
     102
     103
     104bool VarToReg( RELATIVE_VAR &relativeVar, const Type &baseType, Type &resultType ){
     105    const int useReg = REG_EAX;
     106
     107    //大きな型への暗黙の変換
     108    int bigType = AutoBigCast(baseType.GetBasicType(),resultType.GetBasicType());
     109
     110    if(resultType.GetBasicType()&FLAG_PTR){
     111        //配列ポインタ
     112        resultType.SetBasicType( GetPtrType(resultType.GetBasicType()^FLAG_PTR) );
     113
     114        SetVarPtrToReg(useReg, &relativeVar);
     115    }
     116    else if( resultType.IsStruct() ){
     117        //構造体ポインタをeaxへ格納(構造体は値型)
     118        SetVarPtrToReg(useReg, &relativeVar);
     119    }
     120    else if( resultType.IsReal() ){
     121        // 実数
     122        SetReg_RealVariable( resultType.GetBasicType(), &relativeVar );
     123    }
     124    else if( resultType.IsWhole() || resultType.IsObject()){
     125        //整数型
     126        SetReg_WholeVariable(resultType.GetBasicType(),&relativeVar,useReg);
     127    }
     128    else if( resultType.IsStruct() ){
     129        //構造体ポインタをUseRegへ格納(構造体は値型)
     130        SetVarPtrToReg(useReg,&relativeVar);
     131    }
     132    else{
     133        return false;
     134    }
     135
     136    if( resultType.GetBasicType() != bigType ){
     137        // 大きな型へ変換された場合
     138        // ※レジスタの値をキャストする
     139        ExtendRegToBigType( useReg, bigType, resultType.GetBasicType() );
     140
     141        resultType.SetBasicType( bigType );
     142    }
     143
     144    return true;
     145}
     146bool TermMemberOpe( const CClass &objClass, const Type &baseType, Type &resultType, const char *termFull, const char *termLeft, const char *member ){
     147    const int useReg = REG_EAX;
     148
     149    if( GetMemberType( objClass, member, resultType, 0, false ) ){
     150        // メンバが見つかったとき
     151
     152        //オブジェクトポインタをecxにコピー
     153        op_mov_RR( REG_ECX, useReg );
     154
     155        RELATIVE_VAR relativeVar;
     156        relativeVar.dwKind=VAR_DIRECTMEM;
     157
     158        if( !_member_offset(
     159            true,   //エラー表示あり
     160            false,  //読み込み専用
     161            objClass,
     162            member,&relativeVar,resultType,0)){
     163                return false;
     164        }
     165
     166        if( !VarToReg( relativeVar, baseType, resultType ) ){
     167            SetError(11,termFull,cp);
     168        }
     169
     170        return true;
     171    }
     172
     173
     174    ///////////////////////////////////////////////////////////////////
     175    // 動的メソッドを検索
     176    ///////////////////////////////////////////////////////////////////
     177    vector<UserProc *> userProcs;
     178
     179    char methodName[VN_SIZE], lpPtrOffset[VN_SIZE], parameter[VN_SIZE], dummy[1];
     180    CClass::RefType refType;
     181    lstrcpy( methodName, member );
     182    GetVarFormatString(methodName,parameter,lpPtrOffset,dummy,refType);
     183
     184    objClass.EnumMethod( methodName, userProcs );
     185    UserProc *pUserProc;
     186    if(userProcs.size()){
     187        //オーバーロードを解決
     188        pUserProc=OverloadSolutionWithStrParam(termFull,userProcs,parameter,termLeft);
     189
     190        if( pUserProc ){
     191
     192            resultType = pUserProc->ReturnType();
     193
     194            {
     195                //オブジェクトポインタをスタックに入れておく
     196                //push reg
     197                op_push( useReg );
     198
     199                if( !Opcode_CallProc(parameter,pUserProc,PROCFLAG_NEW,termLeft,0 ) ){
     200
     201                    return false;
     202                }
     203
     204                op_pop();
     205
     206                /////////////////////
     207                // 戻り値の処理
     208                /////////////////////
     209
     210                //大きな型への暗黙の変換
     211                int bigType = AutoBigCast(baseType.GetBasicType(), resultType.GetBasicType() );
     212
     213                if( resultType.GetBasicType() != bigType ){
     214                    // 大きな型へ変換された場合
     215                    // ※レジスタの値をキャストする
     216                    ExtendRegToBigType( REG_EAX, bigType, resultType.GetBasicType() );
     217
     218                    resultType.SetBasicType( bigType );
     219                }
     220
     221                //SetUseRegFromRax(resultType.GetBasicType(),UseReg,XmmReg);
     222            }
     223           
     224            return true;
     225        }
     226    }
     227
     228    return false;
     229}
     230bool TermOpe( const char *term, const Type &baseType, Type &resultType, bool &isLiteral, BOOL *pbUseHeap, bool *pIsClassName = NULL ){
     231    char parameter[VN_SIZE];
     232
     233    // Withを解決
     234    char termFull[VN_SIZE];
     235    if(term[0]=='.'){
     236        GetWithName(termFull);
     237        lstrcat(termFull,term);
     238    }
     239    else lstrcpy(termFull,term);
     240
     241    char termLeft[VN_SIZE];
     242    lstrcpy(termLeft,termFull);
     243
     244    // パース
     245    char member[VN_SIZE];
     246    CClass::RefType refType;
     247    if( SplitMemberName( termFull, termLeft, member, refType ) ){
     248        ///////////////////////////////////////////////////////////////////
     249        // オブジェクトとメンバに分解できるとき
     250        // termLeft.member
     251        ///////////////////////////////////////////////////////////////////
     252
     253        isLiteral = false;
     254
     255        // オブジェクト側の型を取得
     256        bool isClassName = false;
     257        Type leftType;
     258        if( !TermOpe( termLeft, baseType, leftType, isLiteral, pbUseHeap, &isClassName ) ){
     259            return false;
     260        }
     261
     262        if( isClassName ){
     263            // 静的メンバ/メソッドの場合
     264            goto globalArea;
     265        }
     266
     267        if( !leftType.HasMember() ){
     268            // メンバを持たない型の場合
     269            return false;
     270        }
     271
     272        return TermMemberOpe( leftType.GetClass(), baseType, resultType, termFull, termLeft, member );
     273    }
     274
     275
     276    //////////////////////////////////////////////
     277    // クラス名かどうかをチェック(静的メンバ用)
     278    //////////////////////////////////////////////
     279
     280    if( pIsClassName ){
     281        if( pobj_DBClass->check( termFull ) ){
     282            *pIsClassName = true;
     283            return true;
     284        }
     285    }
     286
     287
     288    /////////////////////////////////////////////////////////////////
     289    // グローバル属性エリア
     290    /////////////////////////////////////////////////////////////////
     291globalArea:
     292
     293    const int useReg = REG_EAX;
     294
     295
     296    if(lstrcmpi(termFull,"This")==0){
     297        //Thisオブジェクト
     298        resultType.SetType( DEF_OBJECT, pobj_CompilingClass );
     299
     300        SetThisPtrToReg( useReg );
     301
     302        isLiteral = false;
     303
     304        return true;
     305    }
     306
     307
     308    //////////////////////////////////////
     309    // 関数(DLL、ユーザー定義、組み込み)
     310    //////////////////////////////////////
     311    char procName[VN_SIZE];
     312    char temporary[8192];
     313
     314    int i2=GetCallProcName(termFull,procName);
     315    if(termFull[i2]=='('){
     316        int i4=GetStringInPare_RemovePare(parameter,termFull+i2+1);
     317
     318        void *pInfo;
     319        int idProc=GetProc(procName,(void **)&pInfo);
     320
     321        if(idProc){
     322            //閉じカッコ")"に続く文字がNULLでないとき
     323            if(termFull[i2+1+i4+1]!='\0'){
     324                SetError(42,NULL,cp);
     325            }
     326
     327
     328            {
     329                ////////////////
     330                // 呼び出し
     331                ////////////////
     332
     333                CallProc(idProc,pInfo,procName,parameter,resultType);
     334
     335
     336                /////////////////////
     337                // 戻り値の処理
     338                /////////////////////
     339
     340                //大きな型への暗黙の変換
     341                int bigType = AutoBigCast(baseType.GetBasicType(), resultType.GetBasicType() );
     342
     343                /*
     344                ※後でNumOpe内でプッシュする
     345                //スタックへプッシュ
     346                PushReturnValue( resultType.GetBasicType() );
     347                */
     348
     349                if( resultType.GetBasicType() != bigType ){
     350                    // 大きな型へ変換された場合
     351                    // ※レジスタの値をキャストする
     352                    ExtendRegToBigType( useReg, bigType, resultType.GetBasicType() );
     353
     354                    resultType.SetBasicType( bigType );
     355                }
     356
     357                //SetUseRegFromRax(resultType.GetBasicType(),UseReg,XmmReg);
     358            }
     359
     360
     361            if(resultType.IsStruct()){
     362                //構造体が戻ったときはヒープ領域にインスタンスが格納されている
     363                //※後にfreeする必要あり
     364                // TODO: 解放はGCに任せる
     365                *pbUseHeap = 1;
     366            }
     367
     368            isLiteral = false;
     369
     370            return true;
     371        }
     372        else if(GetConstCalcBuffer(procName,parameter,temporary)){
     373            /////////////////////////
     374            // マクロ関数
     375            /////////////////////////
     376
     377            //閉じカッコ")"に続く文字がNULLでないときはエラーにする
     378            if(termFull[i2+1+i4+1]!='\0') SetError(42,NULL,cp);
     379
     380            //マクロ関数の場合
     381            NumOpe(useReg, temporary,Type(),resultType);
     382
     383            if(!IS_LITERAL(resultType.GetIndex())){
     384                //リテラル値ではなかったとき
     385                isLiteral = false;
     386            }
     387
     388            return true;
     389        }
     390    }
     391
     392
     393    ////////////////////////////////
     394    // インデクサ(getアクセサ)
     395    ////////////////////////////////
     396
     397    char VarName[VN_SIZE],ArrayElements[VN_SIZE];
     398    GetArrayElement(termFull,VarName,ArrayElements);
     399    if(ArrayElements[0]){
     400        GetVarType(VarName,resultType,false);
     401        if( resultType.IsObject() ){
     402            CallIndexerGetterProc(/*UseReg,*/&resultType.GetClass(),VarName,ArrayElements,resultType);
     403
     404            isLiteral = false;
     405
     406            return true;
     407        }
     408    }
     409
     410
     411    ////////////////////////////////
     412    // 変数
     413    ////////////////////////////////
     414
     415    RELATIVE_VAR relativeVar;
     416    if(GetVarOffset(
     417        false,  //エラー表示なし
     418        false,  //読み込み専用
     419        termFull,
     420        &relativeVar,resultType)){
     421        //////////
     422        // 変数
     423        //////////
     424
     425        if( !VarToReg( relativeVar, baseType, resultType ) ){
     426            SetError(11,termFull,cp);
     427        }
     428
     429        isLiteral = false;
     430
     431        return true;
     432    }
     433
     434
     435    /////////////////////////////////
     436    // プロパティ用のメソッド
     437    /////////////////////////////////
     438
     439    //配列要素を排除
     440    GetArrayElement(termFull,VarName,ArrayElements);
     441
     442    if(GetSubHash(VarName,0)){
     443
     444        {
     445            CallPropertyMethod(termFull,NULL,resultType);
     446
     447            //大きな型への暗黙の変換
     448            int bigType = AutoBigCast(baseType.GetBasicType(), resultType.GetBasicType() );
     449
     450            if( resultType.GetBasicType() != bigType ){
     451                // 大きな型へ変換された場合
     452                // ※レジスタの値をキャストする
     453                ExtendRegToBigType( REG_EAX, bigType, resultType.GetBasicType() );
     454
     455                resultType.SetBasicType( bigType );
     456            }
     457
     458            //SetUseRegFromRax(resultType.GetBasicType(),UseReg,XmmReg);
     459        }
     460
     461
     462        if(resultType.IsStruct()){
     463            //構造体が戻ったときはヒープ領域にインスタンスが格納されている
     464            //※後にfreeする必要あり
     465            // TODO: 解放はGCに任せる
     466            *pbUseHeap = 1;
     467        }
     468
     469        isLiteral = false;
     470
     471        return true;
     472    }
     473
     474
     475    return false;
     476}
     477
     478
     479bool NumOpe( int reg,
     480            const char *expression,
     481            const Type &baseType,
     482            Type &resultType,
     483            BOOL *pbUseHeap ){
     484
     485    if( !NumOpe( expression, baseType, resultType, pbUseHeap ) ){
     486        return false;
     487    }
     488
     489    if( reg != REG_EAX ){
     490        // TODO: 未実装
     491        SetError();
     492    }
     493
     494    if( resultType.IsReal() ){
     495        //fld ptr[esp]
     496        op_fld_ptr_esp( resultType.GetBasicType() );
     497
     498        //add esp,size
     499        op_add_esp( resultType.GetBasicSize() );
     500    }
     501    else{
     502        //pop eax
     503        op_pop(REG_EAX);
     504
     505        if( resultType.Is64() ){
     506            //pop edx
     507            op_pop(REG_EDX);
     508        }
     509    }
     510    return true;
     511}
    86512bool NumOpe( const char *expression,
    87513            const Type &baseType,
     
    89515            BOOL *pbUseHeap ){
    90516
    91     int i,i2,i3,i4;
    92     char temporary[1024],temp2[1024],temp3[1024];
     517    int i,i2,i3;
     518    char temporary[1024],temp2[1024];
    93519
    94520    if(expression[0]=='\0'){
     
    260686                term=values[i];
    261687
     688                if( calc[i+1]%100 == CALC_AS ){
     689                    // As演算子の右辺値
     690                    //型名
     691                    if( Type::StringToType( term, resultType ) ){
     692                        resultType.SetBasicType( resultType.GetBasicType() | FLAG_CAST );
     693                    }
     694                    else{
     695                        SetError(3, term, cp );
     696                        goto error;
     697                    }
     698
     699                    type_stack[sp] = resultType.GetBasicType();
     700                    index_stack[sp] = resultType.GetIndex();
     701                    sp++;
     702
     703                    break;
     704                }
     705
    262706                if(term[0]=='\"'){
    263707                    //リテラル文字列
     
    269713StrLiteral:
    270714
    271                     if( baseType.IsObject() ){
    272                         if( baseType.IsStringObject() ){
    273                             //要求タイプがStringのとき
    274 
    275                             //String型オブジェクトを生成
    276                             NewStringObject(term);
    277 
    278                             extern CClass *pobj_StringClass;
    279                             type_stack[sp]=DEF_OBJECT;
    280                             index_stack[sp]=(LONG_PTR)pobj_StringClass;
    281                             bLiteralCalculation=0;
    282 
    283                             sp++;
    284                             break;
    285                         }
     715                    if( baseType.IsObject() || baseType.IsNull() ){
     716                        //要求タイプがオブジェクト、または未定のとき
     717
     718                        //String型オブジェクトを生成
     719                        NewStringObject(term);
     720
     721                        extern CClass *pobj_StringClass;
     722                        type_stack[sp]=DEF_OBJECT;
     723                        index_stack[sp]=(LONG_PTR)pobj_StringClass;
     724                        bLiteralCalculation=0;
     725
     726                        sp++;
     727                        break;
    286728                    }
    287729
     
    317759                    // 何らかの識別子
    318760
    319                     //////////////////////////////////////
    320                     // 関数(DLL、ユーザー定義、組み込み)
    321                     //////////////////////////////////////
    322 
    323                     i2=GetCallProcName(term,temporary);
    324                     if(term[i2]=='('){
    325                         i4=GetStringInPare_RemovePare(temp2,term+i2+1);
    326 
    327                         void *pInfo;
    328                         int idProc=GetProc(temporary,(void **)&pInfo);
    329 
    330                         Type resultType;
    331                         if(idProc){
    332                             //閉じカッコ")"に続く文字がNULLでないとき
    333                             if(term[i2+1+i4+1]!='\0'){
    334                                 if( term[i2+1+i4+1] == '.'
    335                                     || term[i2+1+i4+1] == 1 && term[i2+1+i4+2] == ESC_PSMEM ){
    336                                         goto NonProc;
     761                    bool isLiteral;
     762                    if( TermOpe( term, baseType, resultType, isLiteral, &bUseHeap[sp] ) ){
     763                        if(resultType.IsNull()){
     764                            //戻り値が存在しないとき
     765                            for(i2=0;;i2++){
     766                                if(term[i2]=='('||term[i2]=='\0'){
     767                                    term[i2]=0;
     768                                    break;
     769                                }
     770                            }
     771                            SetError(38,term,cp);
     772
     773                            goto error;
     774                        }
     775
     776                        type_stack[sp] = resultType.GetBasicType();
     777                        index_stack[sp] = resultType.GetIndex();
     778
     779                        if( !isLiteral ){
     780                            bLiteralCalculation=0;
     781                        }
     782
     783                        if( resultType.GetBasicType() & FLAG_CAST ){
     784                            // 型名のみ
     785                            SetError();
     786                        }
     787                        else{
     788                            if( resultType.IsReal() ){
     789                                //sub esp,size
     790                                //fstp ptr[esp]
     791                                op_fstp_push( resultType );
     792                            }
     793                            else{
     794                                if( resultType.Is64() ){
     795                                    //push edx
     796                                    op_push( REG_EDX );
    337797                                }
    338798                                else{
    339                                     SetError(42,NULL,cp);
     799                                    ExtendTypeTo32( resultType.GetBasicType(), REG_EAX );
    340800                                }
     801
     802                                //push eax
     803                                op_push( REG_EAX );
    341804                            }
    342 
    343                             ////////////////
    344                             // 呼び出し
    345                             ////////////////
    346 
    347                             CallProc(idProc,pInfo,temporary,temp2,resultType);
    348                             if(resultType.IsNull()){
    349                                 //戻り値が存在しないとき
    350                                 for(i2=2;;i2++){
    351                                     if(term[i2]=='('||term[i2]=='\0'){
    352                                         term[i2]=0;
    353                                         break;
    354                                     }
    355                                 }
    356                                 SetError(38,term,cp);
    357 
    358                                 goto error;
    359                             }
    360 
    361 
    362                             /////////////////////
    363                             // 戻り値の処理
    364                             /////////////////////
    365 
    366                             //大きな型への暗黙の変換
    367                             type_stack[sp]=AutoBigCast(baseType.GetBasicType(),resultType.GetBasicType());
    368                             index_stack[sp] = resultType.GetIndex();
    369                             bLiteralCalculation=0;
    370 
    371                             //スタックへプッシュ
    372                             PushReturnValue( resultType.GetBasicType() );
    373 
    374                             if( Is64Type(type_stack[sp])
    375                                 && resultType.IsWhole()
    376                                 && resultType.GetBasicSize() <= sizeof(long) ){
    377                                     //必要に応じて64ビット拡張
    378                                     ExtendStackTo64( resultType.GetBasicType() );
    379                             }
    380 
    381                             if( resultType.IsStruct() ){
    382                                 //構造体が戻ったときはヒープ領域にインスタンスが格納されている
    383                                 //※後にfreeする必要あり
    384                                 bUseHeap[sp]=1;
    385                             }
    386 
    387                             sp++;
    388                             break;
    389805                        }
    390                         else if(GetConstCalcBuffer(temporary,temp2,temp3)){
    391                             /////////////////////////
    392                             // マクロ関数
    393                             /////////////////////////
    394 
    395                             //閉じカッコ")"に続く文字がNULLでないときはエラーにする
    396                             if(term[i2+1+i4+1]!='\0') SetError(42,NULL,cp);
    397 
    398                             //マクロ関数の場合
    399                             NumOpe(temp3,Type(),resultType);
    400 
    401                             if(!IS_LITERAL(resultType.GetIndex())){
    402                                 //リテラル値ではなかったとき
    403                                 bLiteralCalculation=0;
    404                             }
    405 
    406                             type_stack[sp] = resultType.GetBasicType();
    407                             index_stack[sp] = resultType.GetIndex();
    408 
    409                             sp++;
    410                             break;
    411                         }
    412                     }
    413 NonProc:
    414 
    415 
    416                     //インデクサ(getアクセサ)
    417                     char variable[VN_SIZE],array_element[VN_SIZE];
    418                     GetArrayElement(term,variable,array_element);
    419                     if(array_element[0]){
    420                         Type resultType;
    421                         GetVarType(variable,resultType,0);
    422                         if( resultType.IsObject() ){
    423                             CallIndexerGetterProc(&resultType.GetClass(),variable,array_element,resultType);
    424                             type_stack[sp]=resultType.GetBasicType();
    425                             index_stack[sp]=resultType.GetIndex();
    426                             bLiteralCalculation=0;
    427 
    428                             //push eax
    429                             op_push(REG_EAX);
    430 
    431                             sp++;
    432                             break;
    433                         }
     806
     807                        sp++;
     808                        break;
    434809                    }
    435810
     
    451826                        //push 0
    452827                        op_push_V( 0 );
    453 
    454                         sp++;
    455                         break;
    456                     }
    457 
    458                     RELATIVE_VAR RelativeVar;
    459                     Type varType;
    460                     if(GetVarOffset(
    461                         false,  //エラー表示あり
    462                         false,  //読み込み専用
    463                         term,
    464                         &RelativeVar,varType)){
    465                         //////////
    466                         // 変数
    467                         //////////
    468 
    469                         //大きな型への暗黙の変換
    470                         type_stack[sp]=AutoBigCast(baseType.GetBasicType(),varType.GetBasicType());
    471                         index_stack[sp] = varType.GetIndex();
    472                         bLiteralCalculation=0;
    473 
    474                         if(varType.GetBasicType()&FLAG_PTR){
    475                             //配列ポインタ
    476                             type_stack[sp]=GetPtrType(varType.GetBasicType()^FLAG_PTR);
    477 
    478                             SetVarPtrToEax(&RelativeVar);
    479 
    480                             //push eax
    481                             op_push(REG_EAX);
    482                         }
    483                         else if( varType.IsStruct() ){
    484                             //構造体ポインタをeaxへ格納(構造体は値型)
    485                             SetVarPtrToEax(&RelativeVar);
    486 
    487                             //push eax
    488                             op_push(REG_EAX);
    489                         }
    490                         else if( varType.GetBasicSize() == sizeof(_int64) ){
    491                             //64ビット型
    492                             PushDoubleVariable(&RelativeVar);
    493                         }
    494                         else if( varType.GetBasicSize() == sizeof(long) ){
    495                             //32ビット型
    496                             PushLongVariable(&RelativeVar);
    497                         }
    498                         else if( varType.IsInteger() ){
    499                             PushIntegerVariable(&RelativeVar);
    500                         }
    501                         else if( varType.IsWord() ){
    502                             PushWordVariable(&RelativeVar);
    503                         }
    504                         else if( varType.IsSByte() ){
    505                             PushCharVariable(&RelativeVar);
    506                         }
    507                         else if( varType.IsByte() || varType.IsBoolean() ){
    508                             PushByteVariable(&RelativeVar);
    509                         }
    510                         else SetError(11,term,cp);
    511 
    512                         if( Is64Type(type_stack[sp])
    513                             && varType.IsWhole()
    514                             && varType.GetBasicSize()<=sizeof(long)){
    515                             //必要に応じて64ビット拡張
    516                                 ExtendStackTo64( varType.GetBasicType() );
    517                         }
    518828
    519829                        sp++;
     
    556866
    557867
    558                     //////////////
    559                     // 型名の場合
    560                     //////////////
    561                     Type tempType;
    562                     if( Type::StringToType( term, tempType ) ){
    563                         type_stack[sp] = tempType.GetBasicType() | FLAG_CAST;
    564                         index_stack[sp] = tempType.GetIndex();
    565                         sp++;
    566                         break;
    567                     }
    568 
    569 
    570                     /////////////////////////////////
    571                     // プロパティ用のメソッド
    572                     /////////////////////////////////
    573 
    574                     //配列要素を排除
    575                     char VarName[VN_SIZE],ArrayElements[VN_SIZE];
    576                     GetArrayElement(term,VarName,ArrayElements);
    577 
    578                     if(GetSubHash(VarName,0)){
    579                         Type resultType;
    580                         CallPropertyMethod(term,NULL,resultType);
    581 
    582                         //大きな型への暗黙の変換
    583                         type_stack[sp]=AutoBigCast(baseType.GetBasicType(),resultType.GetBasicType());
    584                         index_stack[sp]=resultType.GetIndex();
    585                         bLiteralCalculation=0;
    586 
    587                         //スタックへプッシュ
    588                         PushReturnValue( resultType.GetBasicType() );
    589 
    590                         if(type_stack[sp]==DEF_STRUCT){
    591                             //構造体が戻ったときはヒープ領域にインスタンスが格納されている
    592                             //※後にfreeする必要あり
    593                             bUseHeap[sp]=1;
    594                         }
    595 
    596                         sp++;
    597                         break;
    598                     }
    599 
    600 
    601 
    602868                    //該当する識別子が見当たらないときはエラー扱いにする
    603869                    bError=1;
Note: See TracChangeset for help on using the changeset viewer.