Ignore:
Timestamp:
Jul 31, 2007, 4:30:31 AM (17 years ago)
Author:
dai_9181
Message:
 
File:
1 edited

Legend:

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

    r206 r254  
    542542}
    543543
    544 bool NumOpe_GetType( const char *expression, const Type &baseType, Type &resultType ){
     544bool NumOpe_GetType( const char *expression, const Type &baseType, Type &resultType, bool *pIsLiteralCalculation ){
    545545    extern int cp;
    546546    int i,i3;
     547
     548    //リテラル値のみの計算かどうかを判別するためのフラグ
     549    bool dummyBool;
     550    if( pIsLiteralCalculation == NULL )
     551    {
     552        pIsLiteralCalculation = &dummyBool;
     553    }
     554    *pIsLiteralCalculation = true;
    547555
    548556    if(expression[0]=='\0'){
     
    553561    if(expression[0]==1&& expression[1]==ESC_NEW ){
    554562        //New演算子(オブジェクト生成)
     563        *pIsLiteralCalculation = false;
    555564        return Operator_New_GetType(expression+2,baseType, resultType );
    556565    }
     
    590599    BOOL bError;
    591600    bError=0;
    592 
    593     //リテラル値のみの計算かどうかを判別するためのフラグ
    594     BOOL bLiteralCalculation=1;
    595601
    596602    int sp;
     
    684690                        type_stack[sp]=DEF_OBJECT;
    685691                        index_stack[sp]=(LONG_PTR)compiler.GetMeta().GetClasses().GetStringClassPtr();
    686                         bLiteralCalculation=0;
     692                        *pIsLiteralCalculation = false;
    687693
    688694                        sp++;
     
    691697
    692698                    type_stack[sp]=typeOfPtrChar;
    693                     bLiteralCalculation=0;
     699                    *pIsLiteralCalculation = false;
    694700                }
    695701                else if((term[0]=='e'||term[0]=='E')&&
     
    711717
    712718                        if( !isLiteral ){
    713                             bLiteralCalculation=0;
     719                            *pIsLiteralCalculation = false;
    714720                        }
    715721
     
    730736                            index_stack[sp] = (LONG_PTR)compiler.GetMeta().GetClasses().GetObjectClassPtr();
    731737                        }
    732                         bLiteralCalculation = 0;
     738                        *pIsLiteralCalculation = false;
    733739                        sp++;
    734740                        break;
     
    784790
    785791                        index_stack[sp]=tempType.GetIndex();
    786                         bLiteralCalculation=0;
     792                        *pIsLiteralCalculation = false;
    787793
    788794                        sp++;
     
    900906    }
    901907
    902     if(bLiteralCalculation){
     908    if( *pIsLiteralCalculation ){
    903909        //右辺値が数値の定数式の場合
    904910        int base_type = 0;
Note: See TracChangeset for help on using the changeset viewer.