Changeset 167 in dev
- Timestamp:
- Jun 17, 2007, 9:56:19 PM (17 years ago)
- Location:
- trunk/abdev
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler32/BasicCompiler.vcproj
r165 r167 1403 1403 </File> 1404 1404 </Filter> 1405 <Filter 1406 Name="Application Classes" 1407 > 1408 <File 1409 RelativePath="..\BasicCompiler_Common\src\Program.cpp" 1410 > 1411 </File> 1412 </Filter> 1405 1413 </Filter> 1406 1414 </Filter> … … 1450 1458 </Filter> 1451 1459 <Filter 1460 Name="Application Classes" 1461 > 1462 <File 1463 RelativePath="..\BasicCompiler_Common\include\Program.h" 1464 > 1465 </File> 1466 </Filter> 1467 <Filter 1452 1468 Name="Common Classes" 1453 1469 > -
trunk/abdev/BasicCompiler_Common/BasicCompiler.cpp
r165 r167 1 #include <jenga/include/common/logger.h> 2 #include <jenga/include/common/Environment.h> 1 #include <Program.h> 3 2 4 3 #include "BasicCompiler.h" … … 163 162 lstrcpy(path,temp3); 164 163 } 165 void GetFullPath( char *path,char *dir){164 void GetFullPath( char *path, const string &baseDirPath ){ 166 165 int i,i2,i3,i4; 167 166 char temporary[MAX_PATH]; … … 186 185 } 187 186 188 i3= lstrlen(dir);i4=0;187 i3=baseDirPath.size();i4=0; 189 188 while(i4<i2){ 190 189 for(i3--;;i3--){ 191 if( dir[i3-1]=='\\'){190 if(baseDirPath[i3-1]=='\\'){ 192 191 i4++; 193 192 break; … … 195 194 } 196 195 } 197 memcpy(temporary, dir,i3);196 memcpy(temporary,baseDirPath.c_str(),i3); 198 197 temporary[i3]=0; 199 198 lstrcat(temporary,path+i); … … 563 562 hInst=hThisInst; 564 563 565 GetModuleFileName(hInst,temporary,MAX_PATH);566 _splitpath(temporary,BasicSystemDir,temp2,NULL,NULL);567 lstrcat(BasicSystemDir,temp2);568 569 564 //不揮発性データを取得 570 565 pobj_nv=new CNonVolatile; … … 742 737 743 738 //インクルードディレクトリを絶対パスに変更 744 GetFullPath(szIncludeDir, BasicSystemDir);739 GetFullPath(szIncludeDir,(Jenga::Common::Environment::GetAppDir()+"\\").c_str()); 745 740 746 741 if(bDll){ -
trunk/abdev/BasicCompiler_Common/BasicCompiler.h
r100 r167 85 85 char *basbuf; 86 86 87 char BasicSystemDir[MAX_PATH]; //BasicCompiler.exeが存在するディレクトリ88 87 char BasicCurDir[MAX_PATH]; //コンパイルするファイルが存在するディレクトリ 89 88 char SourceFileName[MAX_PATH]; -
trunk/abdev/BasicCompiler_Common/Diagnose.cpp
r159 r167 1 #include <Program.h> 2 1 3 #include "../BasicCompiler_Common/common.h" 2 4 … … 19 21 extern int GlobalOpBufferSize; 20 22 sprintf(temporary, "%d", GlobalOpBufferSize/1024 ); 21 Smoothie::Logger::Put( (string)"グローバル領域のコードサイズ: " + temporary + "KB" );23 trace_for_size( (string)"グローバル領域のコードサイズ: " + temporary + "KB" ); 22 24 sprintf(temporary, "%d", (obp-GlobalOpBufferSize)/1024 ); 23 Smoothie::Logger::Put( (string)"ローカル領域のコードサイズ: " + temporary + "KB" );25 trace_for_size( (string)"ローカル領域のコードサイズ: " + temporary + "KB" ); 24 26 sprintf(temporary, "%d", obp/1024 ); 25 Smoothie::Logger::Put( (string)"コードサイズ総量: " + temporary + "KB" );27 trace_for_size( (string)"コードサイズ総量: " + temporary + "KB" ); 26 28 } 27 29 … … 51 53 52 54 sprintf(temporary, "%d", codeSizeOfGlobalProc/1024 ); 53 Smoothie::Logger::Put( (string)"グローバル関数のコードサイズ総量: " + temporary + "KB" );55 trace_for_size( (string)"グローバル関数のコードサイズ総量: " + temporary + "KB" ); 54 56 sprintf(temporary, "%d", codeSizeOfClassMethod/1024 ); 55 Smoothie::Logger::Put( (string)"クラスメソッドのコードサイズ総量: " + temporary + "KB" );57 trace_for_size( (string)"クラスメソッドのコードサイズ総量: " + temporary + "KB" ); 56 58 } 57 59 … … 92 94 93 95 sprintf(temporary, "%d", codeSizeOfEnum/1024 ); 94 Smoothie::Logger::Put( (string)"Enumのコードサイズ総量: " + temporary + "KB" );96 trace_for_size( (string)"Enumのコードサイズ総量: " + temporary + "KB" ); 95 97 } 96 98 97 Smoothie::Logger::Put( "\n\n" );99 trace_for_size( "\n\n" ); 98 100 99 101 { … … 130 132 lstrcat( temporary, "------------------------------------------------------------------\n" ); 131 133 lstrcat( temporary, "\n" ); 132 Smoothie::Logger::Put( temporary );134 trace_for_size( temporary ); 133 135 } 134 136 } -
trunk/abdev/BasicCompiler_Common/Enum.cpp
r103 r167 1 #include <jenga/include/common/logger.h> 2 1 3 #include "common.h" 2 4 … … 286 288 287 289 // ログを生成 288 Smoothie::Logger::PutFile( "enum_generated.log", buffer ); 290 Jenga::Common::Logger logger( Jenga::Common::Environment::GetAppDir() + "\\enum_generated.log" ); 291 logger << buffer << endl; 289 292 290 293 return buffer; -
trunk/abdev/BasicCompiler_Common/MakeExe.cpp
r100 r167 59 59 int i2,i3; 60 60 char temp2[MAX_PATH]; 61 62 //ログ用バッファを初期化63 Smoothie::Logger::Initialize();64 61 65 62 //プログレスバーの設定 -
trunk/abdev/BasicCompiler_Common/ParamImpl.cpp
r165 r167 1 #include < jenga/include/common/logger.h>1 #include <Program.h> 2 2 3 3 #include "common.h" … … 207 207 208 208 if(EvaluateOverloadScore( level, pTempUserProc->Params(), isEnabledReturnType?pTempUserProc->ReturnType():Type() )){ 209 trace ( "レベル" << level << " ○適合..." << pTempUserProc->_paramStr );209 trace_for_overload( "レベル" << level << " ○適合..." << pTempUserProc->_paramStr ); 210 210 211 211 if(sw){ … … 218 218 // 戻り値も比較するモードにして再びオーバーロード解決を試みる 219 219 220 trace ( "戻り値も比較するモードに切り替えてオーバーロード解決を試みる" );220 trace_for_overload( "戻り値も比較するモードに切り替えてオーバーロード解決を試みる" ); 221 221 222 222 return OverloadSolution(name,subs, true); … … 229 229 else 230 230 { 231 trace ( "レベル" << level << " ×不適合..." << pTempUserProc->_paramStr );231 trace_for_overload( "レベル" << level << " ×不適合..." << pTempUserProc->_paramStr ); 232 232 } 233 233 } … … 262 262 } 263 263 UserProc *ParamImpl::OverloadSolution( const char *name, std::vector<UserProc *> &subs, bool isEnabledReturnType ){ 264 trace ( "" );265 trace ( "■■■■■■■■■■■■■■■■■■" );266 trace ( "■■■ オーバーロード解決(" << name << ")" );264 trace_for_overload( "" ); 265 trace_for_overload( "■■■■■■■■■■■■■■■■■■" ); 266 trace_for_overload( "■■■ オーバーロード解決(" << name << ")" ); 267 267 268 268 UserProc *result = _OverloadSolution( name, subs, isEnabledReturnType ); 269 269 270 trace ( "■■■ ここまで" );271 trace ( "■■■■■■■■■■■■■■■■■■" );272 trace ( "" );270 trace_for_overload( "■■■ ここまで" ); 271 trace_for_overload( "■■■■■■■■■■■■■■■■■■" ); 272 trace_for_overload( "" ); 273 273 274 274 return result; -
trunk/abdev/BasicCompiler_Common/common.h
r165 r167 90 90 extern HWND hOwnerEditor; 91 91 extern HANDLE hHeap; 92 extern char BasicSystemDir[MAX_PATH];93 92 extern int cp; 94 93 extern bool isUnicode; … … 288 287 void epi_check(); 289 288 void GetRelationalPath(char *path,char *dir); 290 void GetFullPath( char *path,char *dir);289 void GetFullPath( char *path, const string &baseDirPath ); 291 290 void ShowErrorLine(int LineNum,char *FileName); 292 291 BOOL GetFilePathDialog(HWND hwnd,char *filename,LPSTR Filter,LPSTR Title,BOOL bOpen); -
trunk/abdev/BasicCompiler_Common/error.cpp
r165 r167 1 #include < jenga/include/common/logger.h>1 #include <Program.h> 2 2 3 3 #include "../BasicCompiler_Common/common.h" -
trunk/abdev/BasicCompiler_Common/include/Smoothie.h
r159 r167 7 7 public: 8 8 9 class Logger{10 static string log;11 public:12 static void Initialize(){13 #ifdef _DEBUG14 log = "";15 16 ofstream ofs( ( (string)BasicSystemDir + "Log\\compile.log" ).c_str(), ios_base::trunc );17 ofs.close();18 #endif19 }20 static void Put( const string &text );21 static void PutFile( const string &fileName, const string &buffer ){22 ofstream ofs( ( (string)BasicSystemDir + "Log\\" + fileName ).c_str() );23 ofs << buffer << endl;24 ofs.close();25 }26 };27 28 9 class Lexical{ 29 10 public: 11 static string baseProjectDirPath; 30 12 static BasicSource source; 31 13 static NamespaceScopes liveingNamespaceScopes; -
trunk/abdev/BasicCompiler_Common/include/option.h
r165 r167 19 19 #endif 20 20 21 22 // ログ関係 23 21 24 // ログ生成しない場合はこの下の行をコメントアウトする 22 25 #define USE_TRACE 26 27 // オーバーロードに関するログを生成する 28 #define USE_TRACE_FOR_OVERLOAD 29 30 // モジュールサイズに関するログを生成する 31 #define USE_TRACE_FOR_SIZE 23 32 24 33 … … 28 37 29 38 #ifdef USE_TRACE 30 #define trace(s) Jenga::Common::logger << s << endl39 #define trace(s) Program::logger << s << endl 31 40 #else 32 41 #define trace(s) 33 42 #endif 43 44 #ifdef USE_TRACE_FOR_OVERLOAD 45 #define trace_for_overload(s) trace(s) 46 #else 47 #define trace_for_overload(s) 48 #endif 49 50 #ifdef USE_TRACE_FOR_SIZE 51 #define trace_for_size(s) trace(s) 52 #else 53 #define trace_for_size(s) 54 #endif -
trunk/abdev/BasicCompiler_Common/src/Smoothie.cpp
r159 r167 1 1 #include <..\common.h> 2 3 string Smoothie::Logger::log = "";4 5 void Smoothie::Logger::Put( const string &text )6 {7 //#ifdef _DEBUG8 log += text + "\r\n";9 10 {11 ofstream ofs( ( (string)BasicSystemDir + "Log\\compile.log" ).c_str(), ios_base::app );12 ofs << text << endl;13 ofs.close();14 }15 //#endif16 }17 2 18 3 BasicSource Smoothie::Lexical::source;
Note:
See TracChangeset
for help on using the changeset viewer.