Changeset 558 in dev for trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer_Class.cpp
- Timestamp:
- May 5, 2008, 10:41:25 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer_Class.cpp
r557 r558 248 248 } 249 249 250 void OverrideErrorCheck( const DynamicMethod::OverrideResult &result ) 251 { 252 switch( result.enumType ) 253 { 254 case DynamicMethod::OverrideResult::Successful: 255 break; 256 case DynamicMethod::OverrideResult::NotVirtual: 257 compiler.errorMessenger.Output(136, result.pMethod->GetUserProc().GetName(), cp); 258 break; 259 case DynamicMethod::OverrideResult::NotUseOverrideModifier: 260 compiler.errorMessenger.Output(127, result.pMethod->GetUserProc().GetName(), cp); 261 break; 262 case DynamicMethod::OverrideResult::DifferentAccesibility: 263 compiler.errorMessenger.Output(128, result.pMethod->GetUserProc().GetName(), cp); 264 break; 265 default: 266 throw; 267 } 268 } 269 250 270 void LexicalAnalyzer::AddMethod(CClass *pobj_c, UserProc *pUserProc, Prototype::Accessibility accessibility, BOOL bStatic, bool isConst, bool isAbstract, 251 271 bool isVirtual, bool isOverride, const char *interfaceName, bool isAutoGeneration, int nowLine) … … 320 340 321 341 // メソッドのオーバーライド 322 CMethod *pMethodForOverride = pobj_c->GetDynamicMethods().FindForOverride( pobj_c->GetSuperClassActualTypeParameters(), pUserProc );342 DynamicMethod *pMethodForOverride = pobj_c->GetDynamicMethods().FindForOverride( pobj_c->GetSuperClassActualTypeParameters(), pUserProc ); 323 343 if( pMethodForOverride ) 324 344 { 325 pMethodForOverride->Override( pUserProc, accessibility, isOverride ); 345 DynamicMethod::OverrideResult result; 346 result.enumType = pMethodForOverride->Override( pUserProc, accessibility, isOverride ); 347 result.pMethod = pMethodForOverride; 348 OverrideErrorCheck( result ); 349 326 350 pUserProc->SetMethod( pMethodForOverride ); 327 351 return; … … 349 373 } 350 374 351 CMethod *pMethodForOverride = pInterface->GetDynamicMethods().FindForOverride( pInterface->GetActualTypeParameters(), pUserProc );375 DynamicMethod *pMethodForOverride = pInterface->GetDynamicMethods().FindForOverride( pInterface->GetActualTypeParameters(), pUserProc ); 352 376 if( pMethodForOverride ) 353 377 { 354 pMethodForOverride->Override( pUserProc, accessibility, isOverride ); 378 DynamicMethod::OverrideResult result; 379 result.enumType = pMethodForOverride->Override( pUserProc, accessibility, isOverride ); 380 result.pMethod = pMethodForOverride; 381 OverrideErrorCheck( result ); 382 355 383 pUserProc->SetMethod( pMethodForOverride ); 356 384 return; … … 512 540 { 513 541 // インターフェイスを継承する 514 currentClass.Implements( *pInterfaceClass, actualTypeParameters, nowLine ); 542 std::vector<DynamicMethod::OverrideResult> overrideResults; 543 currentClass.Implements( *pInterfaceClass, actualTypeParameters, overrideResults ); 544 545 // エラーチェック 546 BOOST_FOREACH( const DynamicMethod::OverrideResult result, overrideResults ) 547 { 548 OverrideErrorCheck( result ); 549 } 515 550 } 516 551 else
Note:
See TracChangeset
for help on using the changeset viewer.