Changeset 383 in dev for trunk/abdev/BasicCompiler_Common/src/Parameter.cpp
- Timestamp:
- Jan 2, 2008, 1:21:43 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/src/Parameter.cpp
r325 r383 1 1 #include "stdafx.h" 2 2 3 4 bool Parameter::Equals( const Parameter ¶m ) const 5 { 6 if( Type::Equals( param ) ) 7 { 8 return true; 9 } 10 else 11 { 12 if( this->isRef && this->GetBasicType() == DEF_ANY && 13 param.isRef == false && param.IsPointer() 14 || 15 this->isRef == false && this->IsPointer() && 16 param.isRef && param.GetBasicType() == DEF_ANY ) 17 { 18 /* ByRef var As Any 19 と 20 var As VoidPtr 21 は同等 22 */ 23 return true; 24 } 25 } 26 27 return false; 28 } 29 bool Parameter::Equals( const Types &actualTypeParametersForThisProc, const Parameter ¶m ) const 30 { 31 if( Equals( param ) ) 32 { 33 return true; 34 } 35 36 if( this->IsTypeParameter() ) 37 { 38 // 型パラメータだったとき 39 if( actualTypeParametersForThisProc[this->GetFormalTypeIndex()].Equals( param ) ) 40 { 41 // 戻り値が等しい 42 return true; 43 } 44 } 45 46 return false; 47 } 48 49 bool Parameters::Equals( const Parameters ¶ms ) const 50 { 51 if( this->size() != params.size() ){ 52 return false; 53 } 54 55 int max = (int)this->size(); 56 for( int i=0; i<max; i++ ){ 57 if( !(*this)[i]->Equals( *params[i] ) ){ 58 return false; 59 } 60 } 61 62 return true; 63 } 64 bool Parameters::Equals( const Types &actualTypeParametersForThisProc, const Parameters ¶ms ) const 65 { 66 if( this->size() != params.size() ){ 67 return false; 68 } 69 70 int max = (int)this->size(); 71 for( int i=0; i<max; i++ ){ 72 if( !(*this)[i]->Equals( actualTypeParametersForThisProc, *params[i] ) ){ 73 return false; 74 } 75 } 76 77 return true; 78 } 3 79 4 80 bool Parameters::Analyze( const char *sourceOfParams, int nowLine )
Note:
See TracChangeset
for help on using the changeset viewer.