Changeset 266 in dev for trunk/abdev/BasicCompiler_Common
- Timestamp:
- Aug 7, 2007, 4:14:06 AM (17 years ago)
- Location:
- trunk/abdev/BasicCompiler_Common
- Files:
-
- 2 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/BasicCompiler.cpp
r232 r266 4 4 5 5 #include <Program.h> 6 #include <Compiler.h> 6 7 7 8 #include "BasicCompiler.h" … … 306 307 } 307 308 void MakeMessageText(char *buffer,char *msg,int flag){ 308 extern BOOL bDll;309 309 char temporary[MAX_PATH]; 310 310 if(bClipCompileView){ … … 321 321 //日本語 322 322 if(flag==0){ 323 if(bDll) sprintf(buffer,"DLLファイル \"%s\" [ %s ]",temporary,msg); 323 if(compiler.IsDll()) 324 { 325 sprintf(buffer,"DLLファイル \"%s\" [ %s ]",temporary,msg); 326 } 324 327 else sprintf(buffer,"実行ファイル \"%s\" [ %s ]",temporary,msg); 325 328 } … … 329 332 //英語 330 333 if(flag==0){ 331 if( bDll) sprintf(buffer,"DLL file \"%s\" [ %s ]",temporary,msg);334 if(compiler.IsDll()) sprintf(buffer,"DLL file \"%s\" [ %s ]",temporary,msg); 332 335 else sprintf(buffer,"Execution file \"%s\" [ %s ]",temporary,msg); 333 336 } … … 563 566 //_Test(); 564 567 565 //MessageBox(0,"starting compiler/debugger","ActiveBasic",MB_OK);568 MessageBox(0,"starting compiler/debugger","ActiveBasic",MB_OK); 566 569 trace( "Start ActiveBasic Compiler!" ); 567 570 … … 608 611 609 612 BOOL bFromEditor=0; 610 bDll=0;611 613 OutputFileName[0]=0; 612 614 if(lpCmdLine[i]&&lpCmdLine[i]!='/'){ … … 711 713 712 714 //DLL生成 713 else if(lstrcmp(temp2,"dll")==0) bDll=1; 715 else if(lstrcmp(temp2,"dll")==0) 716 { 717 compiler.SetTargetModuleType( Compiler::Dll ); 718 } 719 720 // StaticLibrary生成 721 else if( lstrcmp( temp2, "static_library" ) ==0 ) 722 { 723 compiler.SetTargetModuleType( Compiler::StaticLibrary ); 724 } 714 725 715 726 //Unicode … … 752 763 GetFullPath(szIncludeDir,(Jenga::Common::Environment::GetAppDir()+"\\").c_str()); 753 764 754 if( bDll){765 if( compiler.IsDll() ){ 755 766 //DLLファイル名を取得 756 767 _splitpath(OutputFileName,NULL,NULL,szDllName,temporary); -
trunk/abdev/BasicCompiler_Common/BasicCompiler.h
r263 r266 22 22 BOOL bStrict; 23 23 DWORD ImageBase; 24 INCLUDEFILEINFO IncludeFileInfo;25 24 26 25 ERRORINFO *pErrorInfo; … … 68 67 int cp; 69 68 70 BOOL bDll;71 69 int typeOfPtrChar = MAKE_PTR_TYPE(DEF_SBYTE,1); 72 70 int typeOfPtrUChar = MAKE_PTR_TYPE(DEF_BYTE,1); -
trunk/abdev/BasicCompiler_Common/BreakPoint.cpp
r263 r266 2 2 3 3 #include <jenga/include/common/Environment.h> 4 #include <jenga/include/smoothie/Source.h>5 4 5 #include <Source.h> 6 6 #include <Compiler.h> 7 7 -
trunk/abdev/BasicCompiler_Common/Debug.cpp
r265 r266 350 350 char temporary[1024]; 351 351 352 extern BOOL bDll;353 352 char ExeFilePathForDll[MAX_PATH]; 354 if( bDll){353 if( compiler.IsDll() ){ 355 354 //DLLをデバッグする場合 356 355 extern char szDebugExeForDll[1024]; … … 428 427 memset(&si,0,sizeof(STARTUPINFO)); 429 428 si.cb=sizeof(STARTUPINFO); 430 if( !bDll){429 if( !compiler.IsDll() ){ 431 430 //EXEファイルをデバッグ 432 431 CreateProcess(OutputFileName,szDebugCmdLine,NULL,NULL,0,NORMAL_PRIORITY_CLASS|DEBUG_ONLY_THIS_PROCESS,NULL,NULL,&si,&pi); -
trunk/abdev/BasicCompiler_Common/DebugMiddleFile.cpp
r265 r266 84 84 85 85 // サイズ 86 *(long *)(buffer+i2) = textString.size();86 *(long *)(buffer+i2) = (long)textString.size(); 87 87 i2+=sizeof(long); 88 88 … … 99 99 // バッファ 100 100 memcpy( buffer+i2, textString.c_str(), textString.size() ); 101 i2 += textString.size();101 i2 += (int)textString.size(); 102 102 } 103 103 … … 111 111 i2+=lstrlen(buffer+i2)+1; 112 112 } 113 buffer[i2++]=0;114 113 for(i3=0;;i3++){ 115 114 buffer[i2++]=(char)IncludeFileInfo.LineOfFile[i3]; … … 122 121 } 123 122 } 124 125 //ソースコード126 {127 //バッファが足りない場合は再確保128 int bufferLen = lstrlen( basbuf );129 if(BufferSize<i2+(int)bufferLen+32768){130 while( BufferSize<i2+(int)bufferLen+32768 )131 {132 BufferSize+=32768;133 }134 135 buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize);136 }137 }138 lstrcpy(buffer+i2,basbuf);139 i2+=lstrlen( buffer + i2 )+1;140 123 141 124 … … 246 229 if(_IncludeFileInfo.LineOfFile[i3]==-1) break; 247 230 } 248 249 //ソースコード250 i2++;251 source.SetBuffer( buffer + i2 );252 i2+=lstrlen(buffer+i2)+1;253 231 254 232 //コードと行番号の関係 … … 416 394 IncludeFileInfo=this->_IncludeFileInfo; 417 395 418 //ソースコード419 Smoothie::Lexical::source = source;420 421 396 //コードと行番号の関係 422 397 extern SourceLines oldSourceLines; -
trunk/abdev/BasicCompiler_Common/DebugSection.h
r265 r266 1 1 #pragma once 2 2 3 #include <jenga/include/smoothie/Source.h> 4 3 #include <Source.h> 5 4 #include <Compiler.h> 6 5 … … 31 30 //インクルード情報 32 31 INCLUDEFILEINFO _IncludeFileInfo; 33 34 //ソースコード35 BasicSource source;36 32 37 33 //コードと行番号の関係 -
trunk/abdev/BasicCompiler_Common/Enum.cpp
r215 r266 115 115 iEnumParentNum=0; 116 116 117 const char *source = Smoothie::Lexical::source.GetBuffer();117 const char *source = compiler.GetObjectModule().source.GetBuffer(); 118 118 119 119 // 名前空間管理 -
trunk/abdev/BasicCompiler_Common/MakeExe.cpp
r265 r266 24 24 25 25 //最後尾に貼り付け 26 Smoothie::Lexical::source.Addition( temp );26 compiler.GetObjectModule().source.Addition( temp ); 27 27 28 28 HeapDefaultFree(temp); … … 38 38 char temp2[MAX_PATH]; 39 39 40 // 開始時刻を記録 41 DWORD beforeTickCount = GetTickCount(); 42 40 43 //プログレスバーの設定 41 44 PostMessage(GetDlgItem(hMainDlg,IDC_PROGRESS),PBM_SETRANGE,0,MAKELPARAM(0,6)); … … 54 57 //プログラムをファイルから読み込む 55 58 extern char SourceFileName[MAX_PATH]; 56 if( ! Smoothie::Lexical::source.ReadFile( SourceFileName ) ){59 if( !compiler.GetObjectModule().source.ReadFile( SourceFileName ) ){ 57 60 SetError(201,SourceFileName,-1); 58 61 goto EndCompile; … … 61 64 //イメージベースの設定 62 65 extern DWORD ImageBase; 63 extern BOOL bDll; 64 if(bDll) ImageBase=0x10000000; 66 if(compiler.IsDll()) ImageBase=0x10000000; 65 67 else ImageBase=0x00400000; 66 68 … … 179 181 if(bError==0){ 180 182 //"コンパイルは正常に完了しました(エラー:%d、警告:%d)" 181 sprintf(temp2,STRING_COMPILE_SUCCESS,ErrorNum-CompileMsgNum-WarningNum,WarningNum); 183 sprintf(temp2, 184 STRING_COMPILE_SUCCESS, 185 ErrorNum-CompileMsgNum-WarningNum, 186 WarningNum, 187 ((double)(GetTickCount() - beforeTickCount))/1000 188 ); 182 189 } 183 190 else{ -
trunk/abdev/BasicCompiler_Common/PESchedule.cpp
r253 r266 1 1 #include "stdafx.h" 2 3 #include <Compiler.h> 2 4 3 5 #include "../BasicCompiler_Common/common.h" … … 55 57 56 58 void CReloc::AddSchedule_CodeSection(DWORD addr){ 57 extern BOOL bDll; 58 if(!bDll) return; 59 if( !compiler.IsDll() ) return; 59 60 60 61 codeSectionAddresses.push_back( addr ); 61 62 } 62 63 void CReloc::AddSchedule_DataSection(DWORD addr){ 63 extern BOOL bDll; 64 if(!bDll) return; 64 if( !compiler.IsDll() ) return; 65 65 66 66 dataSectionAddresses.push_back( addr ); … … 68 68 69 69 void CReloc::__add(DWORD addr){ 70 extern BOOL bDll; 71 if(!bDll) return; 70 if( !compiler.IsDll() ) return; 72 71 73 72 BOOL sw; -
trunk/abdev/BasicCompiler_Common/StrOperation.cpp
r206 r266 2 2 3 3 #include <jenga/include/smoothie/LexicalAnalysis.h> 4 #include <jenga/include/smoothie/Source.h> 4 5 #include <Source.h> 5 6 6 7 #include "../BasicCompiler_Common/common.h" -
trunk/abdev/BasicCompiler_Common/common_msg_jpn.h
r232 r266 32 32 33 33 #define STRING_COMPILE_STOP "コンパイルはユーザーにより中断されました。" 34 #define STRING_COMPILE_SUCCESS "コンパイルは正常に完了しました(エラー:%d、警告:%d )。"34 #define STRING_COMPILE_SUCCESS "コンパイルは正常に完了しました(エラー:%d、警告:%d、所要時間:%.2fsec)。" 35 35 #define STRING_COMPILE_ERROR "コンパイルは中断されました(エラー:%d、警告:%d)。" 36 36 -
trunk/abdev/BasicCompiler_Common/include/Class.h
r232 r266 6 6 #include <Method.h> 7 7 #include <Member.h> 8 #include <Source.h> 8 9 9 10 class UserProc; -
trunk/abdev/BasicCompiler_Common/include/Compiler.h
r265 r266 22 22 : pObjectModule( new ObjectModule ) 23 23 , pNowObjectModule( pObjectModule ) 24 , targetModuleType( Exe ) 24 25 { 25 26 } … … 40 41 Linker linker; 41 42 43 // オブジェクトモジュール 42 44 ObjectModule &GetObjectModule() 43 45 { … … 49 51 } 50 52 53 54 // ターゲット 55 enum TargetModuleType 56 { 57 Exe, 58 Dll, 59 StaticLibrary, 60 }; 61 62 TargetModuleType targetModuleType; 63 64 bool IsExe() const 65 { 66 if( targetModuleType == Exe ) 67 { 68 return true; 69 } 70 return false; 71 } 72 bool IsDll() const 73 { 74 if( targetModuleType == Dll ) 75 { 76 return true; 77 } 78 return false; 79 } 80 bool IsStaticLibrary() const 81 { 82 if( targetModuleType == StaticLibrary ) 83 { 84 return true; 85 } 86 return false; 87 } 88 void SetTargetModuleType( TargetModuleType targetModuleType ) 89 { 90 this->targetModuleType = targetModuleType; 91 } 92 93 94 51 95 static bool StringToType( const std::string &typeName, Type &type ); 52 96 static const std::string TypeToString( const Type &type ); -
trunk/abdev/BasicCompiler_Common/include/Linker.h
r263 r266 12 12 // データテーブル 13 13 DataTable dataTable; 14 15 // ソースコード 16 BasicSource source; 14 17 15 18 // XMLシリアライズ用 … … 27 30 ar & BOOST_SERIALIZATION_NVP( globalNativeCode ); 28 31 ar & BOOST_SERIALIZATION_NVP( dataTable ); 32 ar & BOOST_SERIALIZATION_NVP( source ); 29 33 } 30 34 }; -
trunk/abdev/BasicCompiler_Common/include/Member.h
r206 r266 3 3 #include <string> 4 4 #include <vector> 5 6 #include <jenga/include/smoothie/Source.h>7 5 8 6 #include <option.h> -
trunk/abdev/BasicCompiler_Common/include/Procedure.h
r259 r266 1 1 #pragma once 2 3 #include <jenga/include/smoothie/Source.h>4 2 5 3 #include <Hashmap.h> … … 12 10 #include <Variable.h> 13 11 #include <CodeGenerator.h> 12 #include <Source.h> 14 13 15 14 class CClass; … … 43 42 44 43 // XMLシリアライズ用 45 private:46 44 private: 47 45 friend class boost::serialization::access; -
trunk/abdev/BasicCompiler_Common/src/Class.cpp
r265 r266 2 2 3 3 #include <jenga/include/smoothie/Smoothie.h> 4 #include <jenga/include/smoothie/Source.h>5 4 #include <jenga/include/smoothie/SmoothieException.h> 6 5 #include <jenga/include/smoothie/LexicalAnalysis.h> 7 6 7 #include <Source.h> 8 8 #include <Class.h> 9 9 #include <Compiler.h>
Note:
See TracChangeset
for help on using the changeset viewer.