Changeset 508 in dev for trunk/ab5.0/abdev
- Timestamp:
- Apr 29, 2008, 11:36:37 AM (17 years ago)
- Location:
- trunk/ab5.0/abdev
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/BasicCompiler_Common/VarList.cpp
r467 r508 7 7 //デバッグ用 8 8 #include "../BasicCompiler_Common/debug.h" 9 10 using namespace ActiveBasic::Compiler; 9 11 10 12 //変数リストのツリーハンドル … … 445 447 //Thisポインタを取得 446 448 LONG_PTR pThis; 447 const Variable *pVar = pUserProc->GetLocalVars().Find( Symbol( "_System_LocalThis" ) );449 const Variable *pVar = pUserProc->GetLocalVars().Find( LexicalAnalyzer::FullNameToSymbol( "_System_LocalThis" ) ); 448 450 if( !pVar ){ 449 451 return; -
trunk/ab5.0/abdev/BasicCompiler_Common/VariableOpe.cpp
r507 r508 12 12 #include "../compiler_x86/opcode.h" 13 13 #endif 14 15 using namespace ActiveBasic::Compiler; 14 16 15 17 BOOL IsPtrType(int type){ … … 563 565 ///////////////// 564 566 565 pVar = UserProc::CompilingUserProc().GetLocalVars().BackSearch( Symbol( VarName ) );567 pVar = UserProc::CompilingUserProc().GetLocalVars().BackSearch( LexicalAnalyzer::FullNameToSymbol( VarName ) ); 566 568 if( pVar ){ 567 569 goto ok; … … 614 616 GetNowStaticVarFullName(VarName,temporary); 615 617 616 pVar = compiler.GetObjectModule().meta.GetGlobalVars().Find( Symbol( temporary ) );618 pVar = compiler.GetObjectModule().meta.GetGlobalVars().Find( LexicalAnalyzer::FullNameToSymbol( temporary ) ); 617 619 if( pVar ){ 618 620 goto ok; … … 643 645 sprintf(temp2,"%s.%s",VarName,temporary); 644 646 645 pVar = compiler.GetObjectModule().meta.GetGlobalVars().Find( Symbol( temp2 ) );647 pVar = compiler.GetObjectModule().meta.GetGlobalVars().Find( LexicalAnalyzer::FullNameToSymbol( temp2 ) ); 646 648 if( pVar ){ 647 649 lstrcpy(member,tempMember); … … 656 658 sprintf(temp2,"%s.%s",compiler.pCompilingClass->GetName().c_str(),VarName); 657 659 658 pVar = compiler.GetObjectModule().meta.GetGlobalVars().Find( Symbol( temp2 ) );660 pVar = compiler.GetObjectModule().meta.GetGlobalVars().Find( LexicalAnalyzer::FullNameToSymbol( temp2 ) ); 659 661 if( pVar ){ 660 662 goto ok; … … 667 669 //////////////////// 668 670 669 pVar = compiler.GetObjectModule().meta.GetGlobalVars().BackSearch( Symbol( VarName ) );671 pVar = compiler.GetObjectModule().meta.GetGlobalVars().BackSearch( LexicalAnalyzer::FullNameToSymbol( VarName ) ); 670 672 if( pVar ){ 671 673 goto ok; … … 941 943 ///////////////////////// 942 944 943 if( compiler.GetObjectModule().meta.GetGlobalVars().DuplicateCheck( Symbol( name ) ) ){945 if( compiler.GetObjectModule().meta.GetGlobalVars().DuplicateCheck( LexicalAnalyzer::FullNameToSymbol( name ) ) ){ 944 946 //2重定義のエラー 945 947 compiler.errorMessenger.Output(15,name,cp); … … 1167 1169 { 1168 1170 char temporary[255]; 1169 if( compiler.GetObjectModule().meta.GetGlobalVars().Find( Symbol( "_DebugSys_dwThreadID" ) ) == NULL )1171 if( compiler.GetObjectModule().meta.GetGlobalVars().Find( LexicalAnalyzer::FullNameToSymbol( "_DebugSys_dwThreadID" ) ) == NULL ) 1170 1172 { 1171 1173 // 未定義の場合は定義する -
trunk/ab5.0/abdev/BasicCompiler_Common/WatchList.cpp
r485 r508 13 13 //デバッグ用 14 14 #include "debug.h" 15 16 using namespace ActiveBasic::Compiler; 15 17 16 18 int Debugging_GetArray( const Subscripts &subscripts,char *array,const Type &type,LONG_PTR *plpOffset); … … 350 352 ///////////////// 351 353 if( UserProc::IsLocalAreaCompiling() ){ 352 const Variable *pVar = UserProc::CompilingUserProc().GetLocalVars().Find( Symbol( VarName ) );354 const Variable *pVar = UserProc::CompilingUserProc().GetLocalVars().Find( LexicalAnalyzer::FullNameToSymbol( VarName ) ); 353 355 354 356 if( pVar ){ … … 436 438 /////////////////// 437 439 438 const Variable *pVar = compiler.GetObjectModule().meta.GetGlobalVars().Find( VarName);440 const Variable *pVar = compiler.GetObjectModule().meta.GetGlobalVars().Find( LexicalAnalyzer::FullNameToSymbol( VarName ) ); 439 441 if( !pVar ){ 440 442 //一致しないとき -
trunk/ab5.0/abdev/BasicCompiler_Common/gc.cpp
r485 r508 8 8 #include "../compiler_x86/opcode.h" 9 9 #endif 10 11 using namespace ActiveBasic::Compiler; 10 12 11 13 void InitGCVariables(void){ … … 19 21 /////////////////////////////// 20 22 21 if( compiler.GetObjectModule().meta.GetGlobalVars().Find( Symbol( "_System_gc_StackRoot_StartPtr" ) ) == NULL )23 if( compiler.GetObjectModule().meta.GetGlobalVars().Find( LexicalAnalyzer::FullNameToSymbol( "_System_gc_StackRoot_StartPtr" ) ) == NULL ) 22 24 { 23 25 // 未定義の場合は定義する -
trunk/ab5.0/abdev/BasicCompiler_Common/include/Compiler.h
r507 r508 51 51 : isBuildSuccessful( false ) 52 52 , pObjectModule( new ObjectModule ) 53 , pNowObjectModule( pObjectModule )54 53 , targetModuleType( Exe ) 55 54 , isDebug( false ) … … 57 56 , isCore( false ) 58 57 { 58 SelectObjectModule( *pObjectModule ); 59 59 Symbol::RegistNamespaceSupporter( &namespaceSupporter ); 60 60 } -
trunk/ab5.0/abdev/BasicCompiler_Common/include/LexicalAnalyzer.h
r506 r508 8 8 public: 9 9 static bool CollectNamespaces( const char *source, NamespaceScopesCollection &namespaceScopesCollection ); 10 static Symbol FullNameToSymbol( const char *fullName ); 11 static Symbol FullNameToSymbol( const std::string &fullName ); 10 12 }; 11 13 -
trunk/ab5.0/abdev/BasicCompiler_Common/include/Symbol.h
r505 r508 47 47 { 48 48 } 49 Symbol( const char *fullName );50 Symbol( const string &fullName );51 49 Symbol( const Symbol &symbol ) 52 50 : namespaceScopes( symbol.namespaceScopes ) -
trunk/ab5.0/abdev/BasicCompiler_Common/include/Variable.h
r392 r508 59 59 public: 60 60 Variable( const string &name, const Type &type, bool isConst, bool isRef, const std::string ¶mStrForConstructor, bool hasInitData ) 61 : Symbol( name)61 : Symbol( ActiveBasic::Compiler::LexicalAnalyzer::FullNameToSymbol( name ) ) 62 62 , type( type ) 63 63 , isConst( isConst ) -
trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer.cpp
r506 r508 53 53 return isSuccessful; 54 54 } 55 56 Symbol LexicalAnalyzer::FullNameToSymbol( const char *fullName ) 57 { 58 char areaName[VN_SIZE] = ""; //オブジェクト変数 59 char nestName[VN_SIZE] = ""; //入れ子メンバ 60 bool isNest = SplitMemberName( fullName, areaName, nestName ); 61 62 return Symbol( NamespaceScopes( areaName ), nestName ); 63 } 64 65 Symbol LexicalAnalyzer::FullNameToSymbol( const std::string &fullName ) 66 { 67 return FullNameToSymbol( fullName.c_str() ); 68 } -
trunk/ab5.0/abdev/BasicCompiler_Common/src/ObjectModule.cpp
r507 r508 49 49 50 50 #include <Hashmap.h> 51 #include <Configuration.h> 52 #include <Symbol.h> 53 #include <LexicalAnalyzer.h> 54 #include <Program.h> 51 55 #include <Compiler.h> 56 #include <Debugger.h> 52 57 53 58 -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Symbol.cpp
r504 r508 5 5 6 6 const NamespaceSupporter *Symbol::namespaceSupporter = NULL; 7 8 Symbol::Symbol( const char *fullName )9 : isTargetObjectModule( true )10 {11 char areaName[VN_SIZE] = ""; //オブジェクト変数12 char nestName[VN_SIZE] = ""; //入れ子メンバ13 bool isNest = SplitMemberName( fullName, areaName, nestName );14 15 namespaceScopes = NamespaceScopes( areaName );16 name = nestName;17 }18 Symbol::Symbol( const string &fullName )19 : isTargetObjectModule( true )20 {21 char areaName[VN_SIZE] = ""; //オブジェクト変数22 char nestName[VN_SIZE] = ""; //入れ子メンバ23 bool isNest = SplitMemberName( fullName.c_str(), areaName, nestName );24 25 namespaceScopes = NamespaceScopes( areaName );26 name = nestName;27 }28 7 29 8 std::string Symbol::GetFullName() const -
trunk/ab5.0/abdev/ab_common/src/NamespaceSupporter.cpp
r507 r508 5 5 bool NamespaceSupporter::ImportsNamespace( const NamespaceScopes &namespaceScopes ) 6 6 { 7 _ASSERT( allNamespaceScopesCollection ); 7 8 if( !allNamespaceScopesCollection->IsExist( namespaceScopes ) ){ 8 9 return false; -
trunk/ab5.0/abdev/compiler_x86/Compile_Var.cpp
r465 r508 13 13 int AllLocalVarSize; 14 14 15 using namespace ActiveBasic::Compiler; 15 16 16 17 void SetRelativeOffset( Type &resultType, RELATIVE_VAR *pRelativeVar,const char *lpPtrOffset){ … … 392 393 ////////////////// 393 394 394 const Variable *pVar = UserProc::CompilingUserProc().GetLocalVars().BackSearch( Symbol( VarName ) );395 const Variable *pVar = UserProc::CompilingUserProc().GetLocalVars().BackSearch( LexicalAnalyzer::FullNameToSymbol( VarName ) ); 395 396 if( pVar ){ 396 397 //ポインタ変数の場合 … … 519 520 GetNowStaticVarFullName(VarName,temporary); 520 521 521 pVar = compiler.GetObjectModule().meta.GetGlobalVars().Find( Symbol( temporary ) );522 pVar = compiler.GetObjectModule().meta.GetGlobalVars().Find( LexicalAnalyzer::FullNameToSymbol( temporary ) ); 522 523 if( pVar ){ 523 524 goto GlobalOk; … … 550 551 char temp2[VN_SIZE]; 551 552 sprintf(temp2,"%s.%s",VarName,temporary); 552 pVar = compiler.GetObjectModule().meta.GetGlobalVars().Find( Symbol( temp2 ) );553 pVar = compiler.GetObjectModule().meta.GetGlobalVars().Find( LexicalAnalyzer::FullNameToSymbol( temp2 ) ); 553 554 if( pVar ){ 554 555 lstrcpy(member,tempMember); … … 562 563 char temp2[VN_SIZE]; 563 564 sprintf(temp2,"%s.%s",compiler.pCompilingClass->GetName().c_str(),VarName); 564 pVar = compiler.GetObjectModule().meta.GetGlobalVars().Find( Symbol( temp2 ) );565 pVar = compiler.GetObjectModule().meta.GetGlobalVars().Find( LexicalAnalyzer::FullNameToSymbol( temp2 ) ); 565 566 if( pVar ){ 566 567 goto GlobalOk; … … 572 573 ///////////////////// 573 574 574 pVar = compiler.GetObjectModule().meta.GetGlobalVars().BackSearch( Symbol( VarName ) );575 pVar = compiler.GetObjectModule().meta.GetGlobalVars().BackSearch( LexicalAnalyzer::FullNameToSymbol( VarName ) ); 575 576 if( pVar ){ 576 577 goto GlobalOk; … … 1103 1104 ///////////////// 1104 1105 1105 if( UserProc::CompilingUserProc().GetLocalVars().DuplicateCheck( Symbol( VarName ) ) ){1106 if( UserProc::CompilingUserProc().GetLocalVars().DuplicateCheck( LexicalAnalyzer::FullNameToSymbol( VarName ) ) ){ 1106 1107 //2重定義のエラー 1107 1108 compiler.errorMessenger.Output(15,VarName,cp); -
trunk/ab5.0/abdev/compiler_x86/stdafx.h
r507 r508 42 42 #include <Hashmap.h> 43 43 #include <Configuration.h> 44 #include <Symbol.h> 45 #include <LexicalAnalyzer.h> 44 46 #include <Program.h> 45 47 #include <Compiler.h> 46 48 #include <Debugger.h> 47 #include <LexicalAnalyzer.h>
Note:
See TracChangeset
for help on using the changeset viewer.