Changeset 254 in dev for trunk/abdev/BasicCompiler_Common/NumOpe_GetType.cpp
- Timestamp:
- Jul 31, 2007, 4:30:31 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/NumOpe_GetType.cpp
r206 r254 542 542 } 543 543 544 bool NumOpe_GetType( const char *expression, const Type &baseType, Type &resultType ){544 bool NumOpe_GetType( const char *expression, const Type &baseType, Type &resultType, bool *pIsLiteralCalculation ){ 545 545 extern int cp; 546 546 int i,i3; 547 548 //リテラル値のみの計算かどうかを判別するためのフラグ 549 bool dummyBool; 550 if( pIsLiteralCalculation == NULL ) 551 { 552 pIsLiteralCalculation = &dummyBool; 553 } 554 *pIsLiteralCalculation = true; 547 555 548 556 if(expression[0]=='\0'){ … … 553 561 if(expression[0]==1&& expression[1]==ESC_NEW ){ 554 562 //New演算子(オブジェクト生成) 563 *pIsLiteralCalculation = false; 555 564 return Operator_New_GetType(expression+2,baseType, resultType ); 556 565 } … … 590 599 BOOL bError; 591 600 bError=0; 592 593 //リテラル値のみの計算かどうかを判別するためのフラグ594 BOOL bLiteralCalculation=1;595 601 596 602 int sp; … … 684 690 type_stack[sp]=DEF_OBJECT; 685 691 index_stack[sp]=(LONG_PTR)compiler.GetMeta().GetClasses().GetStringClassPtr(); 686 bLiteralCalculation=0;692 *pIsLiteralCalculation = false; 687 693 688 694 sp++; … … 691 697 692 698 type_stack[sp]=typeOfPtrChar; 693 bLiteralCalculation=0;699 *pIsLiteralCalculation = false; 694 700 } 695 701 else if((term[0]=='e'||term[0]=='E')&& … … 711 717 712 718 if( !isLiteral ){ 713 bLiteralCalculation=0;719 *pIsLiteralCalculation = false; 714 720 } 715 721 … … 730 736 index_stack[sp] = (LONG_PTR)compiler.GetMeta().GetClasses().GetObjectClassPtr(); 731 737 } 732 bLiteralCalculation = 0;738 *pIsLiteralCalculation = false; 733 739 sp++; 734 740 break; … … 784 790 785 791 index_stack[sp]=tempType.GetIndex(); 786 bLiteralCalculation=0;792 *pIsLiteralCalculation = false; 787 793 788 794 sp++; … … 900 906 } 901 907 902 if( bLiteralCalculation){908 if( *pIsLiteralCalculation ){ 903 909 //右辺値が数値の定数式の場合 904 910 int base_type = 0;
Note:
See TracChangeset
for help on using the changeset viewer.