Changeset 350 in dev for trunk/abdev/BasicCompiler_Common
- Timestamp:
- Oct 14, 2007, 9:41:03 PM (17 years ago)
- Location:
- trunk/abdev/BasicCompiler_Common
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/MakeExe.cpp
r322 r350 11 11 extern HWND hMainDlg; 12 12 PostMessage(GetDlgItem(hMainDlg,IDC_PROGRESS),PBM_STEPIT,0,0); 13 } 14 15 void MakeMiddleCode( char *buffer ) 16 { 17 // 改行コードをCRLFからLFにする 18 ChangeReturnCode( buffer ); 19 20 // コメントを除去 21 DeleteComment( buffer ); 22 23 //エスケープシーケンス設定 24 SetEscapeSequenceFormat( buffer ); 25 26 //コマンド対応 27 ChangeCommandToCode( buffer ); 13 28 } 14 29 … … 18 33 lstrcpy(temp,buffer); 19 34 20 // 改行コードをCRLFからLFにする 21 ChangeReturnCode(temp); 22 23 // コメントを除去 24 DeleteComment( temp ); 25 26 //エスケープシーケンス設定 27 SetEscapeSequenceFormat(temp); 28 29 //コマンド対応 30 ChangeCommandToCode(temp); 35 MakeMiddleCode( temp ); 31 36 32 37 //最後尾に貼り付け -
trunk/abdev/BasicCompiler_Common/NumOpe_GetType.cpp
r347 r350 342 342 343 343 vector<const UserProc *> userProcs; 344 leftType.GetClass().EnumDynamicMethodsO fInterfaceMethods( methodName, userProcs );344 leftType.GetClass().EnumDynamicMethodsOrInterfaceMethods( methodName, userProcs ); 345 345 if(userProcs.size()){ 346 346 //オーバーロードを解決 … … 597 597 if( expression[0] == '[' ){ 598 598 if( !baseType.IsPointer() ){ 599 SetError(1,NULL,cp);600 599 return false; 601 600 } … … 716 715 StrLiteral: 717 716 718 if( baseType.IsObject() || baseType.IsNull() ){717 if( !baseType.IsPointer() ){ 719 718 //要求タイプがオブジェクト、または未定のとき 720 719 type_stack[sp]=DEF_OBJECT; -
trunk/abdev/BasicCompiler_Common/common.h
r331 r350 274 274 //MakeExe.cpp 275 275 void StepCompileProgress(void); 276 void MakeMiddleCode( char *buffer ); 276 277 void AddSourceCode(const char *buffer); 277 278 void OutputExe(void); -
trunk/abdev/BasicCompiler_Common/hash.cpp
r347 r350 90 90 else{ 91 91 //動的メソッドから列挙 92 pobj_c->EnumDynamicMethodsO fInterfaceMethods( NestMember, subs );92 pobj_c->EnumDynamicMethodsOrInterfaceMethods( NestMember, subs ); 93 93 } 94 94 … … 105 105 106 106 // 動的メソッド 107 compiler.pCompilingClass->EnumDynamicMethodsO fInterfaceMethods( name, subs );107 compiler.pCompilingClass->EnumDynamicMethodsOrInterfaceMethods( name, subs ); 108 108 } 109 109 … … 157 157 if( pClass ){ 158 158 vector<const UserProc *> userProcs; 159 pClass->EnumDynamicMethodsO fInterfaceMethods( methodName, userProcs );159 pClass->EnumDynamicMethodsOrInterfaceMethods( methodName, userProcs ); 160 160 if( userProcs.size() == 1 ){ 161 161 return userProcs[0]; -
trunk/abdev/BasicCompiler_Common/include/Class.h
r349 r350 386 386 387 387 void AddMethod(CClass *pobj_c, Prototype::Accessibility accessibility, BOOL bStatic, bool isConst, bool isAbstract, 388 bool isVirtual, bool isOverride, char *buffer, int nowLine);388 bool isVirtual, bool isOverride, bool isAutoGeneration, char *buffer, int nowLine); 389 389 390 390 //重複チェック … … 409 409 } 410 410 411 void EnumDynamicMethodsO fInterfaceMethods( const char *methodName, std::vector<const UserProc *> &subs ) const;412 const CMethod *GetDynamicMethodO fInterfaceMethod( const UserProc *pUserProc ) const;411 void EnumDynamicMethodsOrInterfaceMethods( const char *methodName, std::vector<const UserProc *> &subs ) const; 412 const CMethod *GetDynamicMethodOrInterfaceMethod( const UserProc *pUserProc ) const; 413 413 414 414 const Methods &GetStaticMethods() const … … 494 494 public: 495 495 void GetVtblMasterListIndexAndVtblIndex( const UserProc *pUserProc, int &vtblMasterListIndex, int &vtblIndex ) const; 496 int GetVtblMasterListIndex( const CClass *pClass ) const; 496 497 long GetVtblMasterListOffset() const; 497 498 void GenerateVTableMasterList( const std::vector<long> &vtableMasterList, long &offset ); … … 513 514 , pStringClass( NULL ) 514 515 , pObjectClass( NULL ) 516 , pInterfaceInfo( NULL ) 515 517 { 516 518 } -
trunk/abdev/BasicCompiler_Common/include/Procedure.h
r336 r350 323 323 324 324 std::string GetFullName() const; 325 bool IsCastOperator() const; 325 326 326 327 bool IsVirtual() const; -
trunk/abdev/BasicCompiler_Common/include/Type.h
r332 r350 189 189 bool IsAny() const; 190 190 bool IsDelegate() const; 191 bool IsInterface() const; 191 192 192 193 // オブジェクトや構造体など、メンバを持つ型かどうかを判別する -
trunk/abdev/BasicCompiler_Common/include/option.h
r312 r350 19 19 #ifdef USE_TRACE 20 20 // オーバーロードに関するログを生成する 21 //#define USE_TRACE_FOR_OVERLOAD21 #define USE_TRACE_FOR_OVERLOAD 22 22 23 23 // モジュールサイズに関するログを生成する 24 #define USE_TRACE_FOR_SIZE24 //#define USE_TRACE_FOR_SIZE 25 25 26 26 // XMLシリアライズに関するログを生成する 27 #define USE_TRACE_FOR_SERIALIZE27 //#define USE_TRACE_FOR_SERIALIZE 28 28 29 29 // ソースコードステップに関するログを生成する 30 #define USE_TRACE_FOR_SOURCECODESTEP30 //#define USE_TRACE_FOR_SOURCECODESTEP 31 31 #endif 32 32 -
trunk/abdev/BasicCompiler_Common/include/ver.h
r340 r350 6 6 // バージョン付加文字列 7 7 #ifdef _AMD64_ 8 #define VER_INFO "(x64) (rev.35 1)"8 #define VER_INFO "(x64) (rev.356)" 9 9 #else 10 #define VER_INFO "(rev.35 1)"10 #define VER_INFO "(rev.356)" 11 11 #endif -
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.