Changeset 350 in dev for trunk/abdev/BasicCompiler_Common/src
- Timestamp:
- Oct 14, 2007, 9:41:03 PM (17 years ago)
- Location:
- trunk/abdev/BasicCompiler_Common/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/src/Class.cpp
r349 r350 449 449 interfaces.push_back( new ::Interface( &interfaceClass ) ); 450 450 451 // キャストメソッドを追加(内部コードは自動生成すること) 452 { 453 // Function Operator() As ITest 454 455 char temporary[1024]; 456 sprintf(temporary,"%c%c%c%c()%c%c%s", 457 1, ESC_FUNCTION, 458 1, ESC_OPERATOR, 459 1, ESC_AS, 460 interfaceClass.GetName().c_str() 461 ); 462 463 this->AddMethod(this, 464 Prototype::Public, 465 0, 466 false, // isConst 467 false, // isAbstract 468 false, // isVirtual 469 false, // isOverride 470 true, // isAutoGeneration 471 temporary, 472 -1 473 ); 474 } 475 451 476 return true; 452 477 } … … 505 530 506 531 void CClass::AddMethod(CClass *pobj_c, Prototype::Accessibility accessibility, BOOL bStatic, bool isConst, bool isAbstract, 507 bool isVirtual, bool isOverride, char *buffer, int nowLine){532 bool isVirtual, bool isOverride, bool isAutoGeneration, char *buffer, int nowLine){ 508 533 int i,i2; 509 534 char temporary[VN_SIZE]; … … 522 547 UserProc *pUserProc = compiler.GetObjectModule().meta.GetUserProcs().Add( NamespaceScopes(), NamespaceScopesCollection(), buffer,nowLine,isVirtual,pobj_c, (bStatic!=0) ); 523 548 if(!pUserProc) return; 549 550 if( isAutoGeneration ) 551 { 552 // コード自動生成 553 pUserProc->ThisIsAutoGenerationProc(); 554 } 524 555 525 556 … … 665 696 } 666 697 667 void CClass::EnumDynamicMethodsO fInterfaceMethods( const char *methodName, std::vector<const UserProc *> &subs ) const698 void CClass::EnumDynamicMethodsOrInterfaceMethods( const char *methodName, std::vector<const UserProc *> &subs ) const 668 699 { 669 700 // 動的メソッド … … 676 707 } 677 708 } 678 const CMethod *CClass::GetDynamicMethodO fInterfaceMethod( const UserProc *pUserProc ) const709 const CMethod *CClass::GetDynamicMethodOrInterfaceMethod( const UserProc *pUserProc ) const 679 710 { 680 711 // 動的メソッド … … 687 718 { 688 719 result = pInterface->GetDynamicMethods().GetMethodPtr( pUserProc ); 720 if( result ) 721 { 722 return result; 723 } 689 724 } 690 725 } … … 854 889 SetError(); 855 890 return; 891 } 892 int CClass::GetVtblMasterListIndex( const CClass *pClass ) const 893 { 894 int result = 0; 895 896 BOOST_FOREACH( const ::Interface *pInterface, interfaces ) 897 { 898 result++; 899 900 if( &pInterface->GetClass() == pClass ) 901 { 902 return result; 903 } 904 } 905 906 SetError(); 907 return 0; 856 908 } 857 909 long CClass::GetVtblMasterListOffset() const … … 1428 1480 pobj_c->AddMethod(pobj_c, 1429 1481 Prototype::Public, //Publicアクセス権 1430 0, //Static指定なし 1431 false, //Constではない 1432 1, //Abstract 1433 1, //Virtual 1434 0, 1482 0, // bStatic 1483 false, // isConst 1484 true, // isAbstract 1485 true, // isVirtual 1486 false, // isOverride 1487 false, // isAutoGeneration 1435 1488 temporary, 1436 1489 sub_address … … 1719 1772 isVirtual, 1720 1773 isOverride, 1774 false, 1721 1775 temporary, 1722 1776 sub_address); … … 1946 2000 } 1947 2001 1948 pCompilingMethod = pParentClass->GetDynamicMethodO fInterfaceMethod( pUserProc );2002 pCompilingMethod = pParentClass->GetDynamicMethodOrInterfaceMethod( pUserProc ); 1949 2003 if( !pCompilingMethod ){ 1950 2004 pCompilingMethod = pParentClass->GetStaticMethods().GetMethodPtr( pUserProc ); -
trunk/abdev/BasicCompiler_Common/src/Procedure.cpp
r336 r350 24 24 25 25 return GetName(); 26 } 27 bool UserProc::IsCastOperator() const 28 { 29 if( GetName()[0] == 1 && GetName()[1] == ESC_OPERATOR && GetName()[2] == CALC_AS ) 30 { 31 return true; 32 } 33 return false; 26 34 } 27 35 const NamespaceScopes &UserProc::GetNamespaceScopes() const -
trunk/abdev/BasicCompiler_Common/src/Type.cpp
r335 r350 211 211 if( IsObject() ) 212 212 { 213 if( GetClass().IsInterface() ){214 // vtblOffsetのサイズを含める215 return PTR_SIZE*2;216 }217 213 return PTR_SIZE; 218 214 } … … 298 294 bool Type::IsPointer( int basicType ) 299 295 { 296 if( basicType == DEF_NON ) 297 { 298 return false; 299 } 300 300 301 if(PTR_LEVEL( basicType )|| basicType == DEF_PTR_VOID || basicType == DEF_PTR_PROC 301 302 || ( basicType & FLAG_PTR ) ){ … … 448 449 return ( IsObject() && GetClass().IsDelegate() ); 449 450 } 451 bool Type::IsInterface() const 452 { 453 return ( IsObject() && GetClass().IsInterface() ); 454 } 455 450 456 451 457 bool Type::HasMember() const
Note:
See TracChangeset
for help on using the changeset viewer.