- Timestamp:
- Jul 13, 2008, 2:23:09 AM (16 years ago)
- Location:
- trunk/ab5.0/abdev
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/BasicCompiler_Common/Compile.cpp
r668 r684 14 14 15 15 //With情報 16 W ITHINFO WithInfo;16 WithInfos withInfos; 17 17 18 18 //デバッグ用行番号情報 … … 318 318 319 319 case ESC_WITH: 320 extern WITHINFO WithInfo; 321 322 WithInfo.ppName=(char **)HeapReAlloc(hHeap,0,WithInfo.ppName,(WithInfo.num+1)*sizeof(char **)); 323 WithInfo.ppName[WithInfo.num]=(char *)HeapAlloc(hHeap,0,lstrlen(Command+2)+1); 324 lstrcpy(WithInfo.ppName[WithInfo.num],Command+2); 325 326 WithInfo.pWithCp=(int *)HeapReAlloc(hHeap,0,WithInfo.pWithCp,(WithInfo.num+1)*sizeof(int)); 327 WithInfo.pWithCp[WithInfo.num]=cp; 328 329 WithInfo.num++; 330 break; 320 { 321 extern WithInfos withInfos; 322 withInfos.push_back( WithInfo( Command+2, cp ) ); 323 break; 324 } 331 325 case ESC_ENDWITH: 332 if(WithInfo.num<=0){ 333 compiler.errorMessenger.Output(12,"End With",cp); 334 return; 335 } 336 WithInfo.num--; 337 HeapDefaultFree(WithInfo.ppName[WithInfo.num]); 338 break; 326 { 327 extern WithInfos withInfos; 328 if( withInfos.size() <= 0 ) 329 { 330 compiler.errorMessenger.Output(12,"End With",cp); 331 return; 332 } 333 334 withInfos.pop_back(); 335 break; 336 } 339 337 case ESC_DECLARE: 340 338 if( compiler.IsLocalAreaCompiling() ){ -
trunk/ab5.0/abdev/BasicCompiler_Common/VariableOpe.cpp
r649 r684 180 180 181 181 void GetWithName(char *buffer){ 182 extern WITHINFO WithInfo; 183 int i; 184 182 extern WithInfos withInfos; 185 183 buffer[0]=0; 186 for(i=0;i<WithInfo.num;i++) 187 lstrcat(buffer,WithInfo.ppName[i]); 184 BOOST_FOREACH( const WithInfo &withInfo, withInfos ) 185 { 186 lstrcat( buffer, withInfo.name.c_str() ); 187 } 188 188 } 189 189 -
trunk/ab5.0/abdev/compiler_x86/Compile_ProcOp.cpp
r677 r684 433 433 compiler.codeGenerator.gotoLabelSchedules.clear(); 434 434 435 //With情報のメモリを確保 436 extern WITHINFO WithInfo; 437 WithInfo.ppName=(char **)HeapAlloc(hHeap,0,1); 438 WithInfo.pWithCp=(int *)HeapAlloc(hHeap,0,1); 439 WithInfo.num=0; 435 //With情報を初期化 436 extern WithInfos withInfos; 437 withInfos.clear(); 440 438 441 439 // 重複エラー情報をクリア … … 590 588 } 591 589 592 //With情報のメモリを解放593 for(i3=0;i3<WithInfo.num;i3++){594 compiler.errorMessenger.Output(22,"With",WithInfo.pWithCp[i3]);595 HeapDefaultFree(WithInfo.ppName[i3]);596 }597 HeapDefaultFree(WithInfo.ppName);598 HeapDefaultFree(WithInfo.pWithCp);599 600 590 //push ebp 601 591 AllLocalVarSize+=sizeof(long); -
trunk/ab5.0/abdev/compiler_x86/MakePeHdr.cpp
r645 r684 370 370 //compiler.codeGenerator.lexicalScopes.Init( compiler.codeGenerator.GetNativeCodeSize() ); 371 371 372 // 名前空間が初期化されているかをチェック 373 if( compiler.GetNamespaceSupporter().GetLivingNamespaceScopes().size() ) 374 { 375 compiler.errorMessenger.OutputFatalError(); 376 } 377 372 378 373 379 ///////////////////////////////////////////////////////////////// … … 394 400 compiler.StartGlobalAreaCompile(); 395 401 396 if( !compiler.IsDll() ){ 397 // 名前空間が初期化されているかをチェック 398 if( compiler.GetNamespaceSupporter().GetLivingNamespaceScopes().size() ){ 399 compiler.errorMessenger.OutputFatalError(); 400 } 401 402 if( !compiler.IsDll() ) 403 { 402 404 //ラベル管理オブジェクトを初期化 403 405 compiler.codeGenerator.gotoLabels.clear(); … … 406 408 compiler.codeGenerator.gotoLabelSchedules.clear(); 407 409 408 //With情報のメモリを確保 409 extern WITHINFO WithInfo; 410 WithInfo.ppName=(char **)HeapAlloc(hHeap,0,1); 411 WithInfo.pWithCp=(int *)HeapAlloc(hHeap,0,1); 412 WithInfo.num=0; 410 //With情報を初期化 411 extern WithInfos withInfos; 412 withInfos.clear(); 413 413 414 414 //Continueアドレスを初期化 … … 419 419 420 420 trace_for_sourcecodestep( "★★★ グローバル領域のコンパイルを開始" ); 421 422 423 //未完成424 //breakpoint;425 426 421 427 422 if( compiler.IsCore() ) … … 472 467 extern int GlobalOpBufferSize; 473 468 GlobalOpBufferSize = compiler.linker.GetNativeCode().GetSize(); 474 475 //With情報のメモリを解放476 for(i=0;i<WithInfo.num;i++){477 compiler.errorMessenger.Output(22,"With",WithInfo.pWithCp[i]);478 HeapDefaultFree(WithInfo.ppName[i]);479 }480 HeapDefaultFree(WithInfo.ppName);481 HeapDefaultFree(WithInfo.pWithCp);482 469 483 470 // 名前空間が正しく閉じられているかをチェック -
trunk/ab5.0/abdev/compiler_x86/Opcode.h
r673 r684 28 28 29 29 //With情報 30 struct WITHINFO{ 31 char **ppName; 32 int *pWithCp; 33 int num; 30 struct WithInfo 31 { 32 std::string name; 33 int sourceCodePos; 34 35 WithInfo( const std::string &name, int sourceCodePos ) 36 : name( name ) 37 , sourceCodePos( sourceCodePos ) 38 { 39 } 34 40 }; 41 typedef std::vector<WithInfo> WithInfos; 35 42 36 43
Note:
See TracChangeset
for help on using the changeset viewer.