Changeset 364 in dev for trunk/abdev/BasicCompiler_Common/ParamImpl.cpp
- Timestamp:
- Nov 11, 2007, 3:12:06 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/ParamImpl.cpp
r353 r364 107 107 } 108 108 109 bool ParamImpl::EvaluateOverloadScore( int level, const Parameters &targetParms, const Type &targetResultType ){109 bool ParamImpl::EvaluateOverloadScore( int level, const Parameters &targetParms, const Type &targetResultType, bool &isErrored ){ 110 110 //パラメータを識別してオーバーロードを解決 111 112 isErrored = false; 111 113 112 114 //パラメータの個数が不一致の場合 … … 137 139 Type nullParam( DEF_NON ); 138 140 139 NumOpe_GetType(Parms[i],141 if( !NumOpe_GetType(Parms[i], 140 142 ( level <= OVERLOAD_LEVEL3 )? nullParam : param, 141 argType); 143 argType) ) 144 { 145 isErrored = true; 146 return false; 147 } 142 148 } 143 149 else{ … … 206 212 const UserProc *pUserProc = NULL; 207 213 208 for( int level=OVERLOAD_MIN_LEVEL; level<=OVERLOAD_MAX_LEVEL; level++ ){ 209 210 BOOST_FOREACH( const UserProc *pTempUserProc, subs ){ 211 212 if(EvaluateOverloadScore( level, pTempUserProc->Params(), isEnabledReturnType?pTempUserProc->ReturnType():Type() )){ 214 for( int level=OVERLOAD_MIN_LEVEL; level<=OVERLOAD_MAX_LEVEL; level++ ) 215 { 216 BOOST_FOREACH( const UserProc *pTempUserProc, subs ) 217 { 218 bool isErrored = false; 219 bool isHit = false; 220 isHit = EvaluateOverloadScore( level, pTempUserProc->Params(), isEnabledReturnType?pTempUserProc->ReturnType():Type(), isErrored ); 221 if( isErrored ) 222 { 223 // 照合中にエラーが起きた場合 224 return NULL; 225 } 226 227 if( isHit ) 228 { 213 229 trace_for_overload( "レベル" << level << " ○適合..." << pTempUserProc->_paramStr ); 214 230 … … 216 232 if( isEnabledReturnType ){ 217 233 SetError(52,name,cp); 234 return NULL; 218 235 } 219 236 else{ … … 238 255 239 256 if( !pUserProc ){ 240 BOOST_FOREACH( const UserProc *pTempUserProc, subs ) {241 257 BOOST_FOREACH( const UserProc *pTempUserProc, subs ) 258 { 242 259 //エラーチェック 243 if(pTempUserProc->Params().size()==this->ParmsNum){ 244 if( pUserProc ){ 260 if(pTempUserProc->Params().size()==this->ParmsNum) 261 { 262 if( pUserProc ) 263 { 245 264 SetError(52,name,cp); 265 return NULL; 246 266 } 247 267
Note:
See TracChangeset
for help on using the changeset viewer.