Changeset 183 in dev
- Timestamp:
- Jun 24, 2007, 6:50:40 PM (17 years ago)
- Location:
- trunk/abdev
- Files:
-
- 1 deleted
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler32/BasicCompiler.vcproj
r167 r183 75 75 <Tool 76 76 Name="VCLinkerTool" 77 AdditionalDependencies="comctl32.lib psapi.lib commond.lib "77 AdditionalDependencies="comctl32.lib psapi.lib commond.lib smoothied.lib" 78 78 OutputFile="../ActiveBasic/BasicCompiler32.exe" 79 79 LinkIncremental="2" … … 177 177 <Tool 178 178 Name="VCLinkerTool" 179 AdditionalDependencies="comctl32.lib psapi.lib common.lib "179 AdditionalDependencies="comctl32.lib psapi.lib common.lib smoothie.lib" 180 180 OutputFile="../ActiveBasic/BasicCompiler32.exe" 181 181 LinkIncremental="1" … … 581 581 > 582 582 <File 583 RelativePath="..\BasicCompiler_Common\DataTable.cpp"584 >585 </File>586 <File587 RelativePath="..\BasicCompiler_Common\LoopRefCheck.cpp"588 >589 <FileConfiguration590 Name="Debug|Win32"591 >592 <Tool593 Name="VCCLCompilerTool"594 PreprocessorDefinitions=""595 />596 </FileConfiguration>597 <FileConfiguration598 Name="Release|Win32"599 >600 <Tool601 Name="VCCLCompilerTool"602 PreprocessorDefinitions=""603 />604 </FileConfiguration>605 </File>606 <File607 583 RelativePath="..\BasicCompiler_Common\NonVolatile.cpp" 608 584 > … … 751 727 > 752 728 <File 753 RelativePath="..\BasicCompiler_Common\Class.cpp"754 >755 <FileConfiguration756 Name="Debug|Win32"757 >758 <Tool759 Name="VCCLCompilerTool"760 PreprocessorDefinitions=""761 />762 </FileConfiguration>763 <FileConfiguration764 Name="Release|Win32"765 >766 <Tool767 Name="VCCLCompilerTool"768 PreprocessorDefinitions=""769 />770 </FileConfiguration>771 </File>772 <File773 RelativePath="..\BasicCompiler_Common\Class.h"774 >775 </File>776 <File777 729 RelativePath="..\BasicCompiler_Common\Enum.cpp" 778 730 > … … 824 776 <File 825 777 RelativePath="..\BasicCompiler_Common\PESchedule.h" 826 >827 </File>828 </Filter>829 <Filter830 Name="LexicalScoping"831 >832 <File833 RelativePath="..\BasicCompiler_Common\LexicalScoping.cpp"834 >835 <FileConfiguration836 Name="Debug|Win32"837 >838 <Tool839 Name="VCCLCompilerTool"840 PreprocessorDefinitions=""841 />842 </FileConfiguration>843 <FileConfiguration844 Name="Release|Win32"845 >846 <Tool847 Name="VCCLCompilerTool"848 PreprocessorDefinitions=""849 />850 </FileConfiguration>851 </File>852 <File853 RelativePath="..\BasicCompiler_Common\LexicalScoping.h"854 778 > 855 779 </File> … … 1325 1249 </Filter> 1326 1250 <Filter 1327 Name="Common Classes" 1328 > 1329 <File 1330 RelativePath="..\BasicCompiler_Common\src\Smoothie.cpp" 1331 > 1332 </File> 1333 <Filter 1334 Name="Meta Parts" 1335 > 1336 <File 1337 RelativePath="..\BasicCompiler_Common\src\Member.cpp" 1338 > 1339 </File> 1340 <File 1341 RelativePath="..\BasicCompiler_Common\src\Method.cpp" 1342 > 1343 </File> 1344 <File 1345 RelativePath="..\BasicCompiler_Common\src\Namespace.cpp" 1346 > 1347 </File> 1348 <File 1349 RelativePath="..\BasicCompiler_Common\Procedure.cpp" 1350 > 1351 </File> 1352 <File 1353 RelativePath="..\BasicCompiler_Common\src\Prototype.cpp" 1354 > 1355 </File> 1356 <File 1357 RelativePath="..\BasicCompiler_Common\src\Symbol.cpp" 1358 > 1359 </File> 1360 <File 1361 RelativePath="..\BasicCompiler_Common\Type.cpp" 1362 > 1363 </File> 1364 <File 1365 RelativePath="..\BasicCompiler_Common\TypeDef.cpp" 1366 > 1367 <FileConfiguration 1368 Name="Debug|Win32" 1369 > 1370 <Tool 1371 Name="VCCLCompilerTool" 1372 PreprocessorDefinitions="" 1373 /> 1374 </FileConfiguration> 1375 <FileConfiguration 1376 Name="Release|Win32" 1377 > 1378 <Tool 1379 Name="VCCLCompilerTool" 1380 PreprocessorDefinitions="" 1381 /> 1382 </FileConfiguration> 1383 </File> 1384 <File 1385 RelativePath="..\BasicCompiler_Common\Variable.cpp" 1386 > 1387 </File> 1388 </Filter> 1389 <Filter 1390 Name="Lexical Parts" 1391 > 1392 <File 1393 RelativePath="..\BasicCompiler_Common\src\Source.cpp" 1394 > 1395 </File> 1396 </Filter> 1397 <Filter 1398 Name="Operation Statements" 1399 > 1400 <File 1401 RelativePath="..\BasicCompiler_Common\src\Exception.cpp" 1402 > 1403 </File> 1404 </Filter> 1405 <Filter 1406 Name="Application Classes" 1407 > 1408 <File 1409 RelativePath="..\BasicCompiler_Common\src\Program.cpp" 1410 > 1411 </File> 1412 </Filter> 1251 Name="Application Classes" 1252 > 1253 <File 1254 RelativePath="..\BasicCompiler_Common\src\ClassImpl.cpp" 1255 > 1256 </File> 1257 <File 1258 RelativePath="..\BasicCompiler_Common\src\CodeGenerator.cpp" 1259 > 1260 </File> 1261 <File 1262 RelativePath="..\BasicCompiler_Common\src\Compiler.cpp" 1263 > 1264 </File> 1265 <File 1266 RelativePath="..\BasicCompiler_Common\src\DataTable.cpp" 1267 > 1268 </File> 1269 <File 1270 RelativePath="..\BasicCompiler_Common\src\Exception.cpp" 1271 > 1272 </File> 1273 <File 1274 RelativePath="..\BasicCompiler_Common\src\LexicalScopingImpl.cpp" 1275 > 1276 </File> 1277 <File 1278 RelativePath="..\BasicCompiler_Common\src\ProcedureImpl.cpp" 1279 > 1280 </File> 1281 <File 1282 RelativePath="..\BasicCompiler_Common\src\Program.cpp" 1283 > 1284 </File> 1285 <File 1286 RelativePath="..\BasicCompiler_Common\src\SmoothieImpl.cpp" 1287 > 1288 </File> 1413 1289 </Filter> 1414 1290 </Filter> … … 1437 1313 > 1438 1314 </File> 1315 <File 1316 RelativePath="..\BasicCompiler_Common\include\option.h" 1317 > 1318 </File> 1439 1319 <Filter 1440 1320 Name="言語対応文字列" … … 1461 1341 > 1462 1342 <File 1343 RelativePath="..\BasicCompiler_Common\include\ClassImpl.h" 1344 > 1345 </File> 1346 <File 1347 RelativePath="..\BasicCompiler_Common\include\CodeGenerator.h" 1348 > 1349 </File> 1350 <File 1351 RelativePath="..\BasicCompiler_Common\include\Compiler.h" 1352 > 1353 </File> 1354 <File 1355 RelativePath="..\BasicCompiler_Common\include\DataTable.h" 1356 > 1357 </File> 1358 <File 1359 RelativePath="..\BasicCompiler_Common\include\Exception.h" 1360 > 1361 </File> 1362 <File 1363 RelativePath="..\BasicCompiler_Common\include\LexicalScopingImpl.h" 1364 > 1365 </File> 1366 <File 1367 RelativePath="..\BasicCompiler_Common\include\ProcedureImpl.h" 1368 > 1369 </File> 1370 <File 1463 1371 RelativePath="..\BasicCompiler_Common\include\Program.h" 1464 1372 > 1465 1373 </File> 1466 </Filter>1467 <Filter1468 Name="Common Classes"1469 >1470 <File1471 RelativePath="..\BasicCompiler_Common\include\option.h"1472 >1473 </File>1474 <File1475 RelativePath="..\BasicCompiler_Common\include\Smoothie.h"1476 >1477 </File>1478 <Filter1479 Name="Meta Parts"1480 >1481 <File1482 RelativePath="..\BasicCompiler_Common\include\Namespace.h"1483 >1484 </File>1485 <File1486 RelativePath="..\BasicCompiler_Common\Parameter.h"1487 >1488 </File>1489 <File1490 RelativePath="..\BasicCompiler_Common\Procedure.h"1491 >1492 </File>1493 <File1494 RelativePath="..\BasicCompiler_Common\include\Symbol.h"1495 >1496 </File>1497 <File1498 RelativePath="..\BasicCompiler_Common\Type.h"1499 >1500 </File>1501 <File1502 RelativePath="..\BasicCompiler_Common\TypeDef.h"1503 >1504 </File>1505 <File1506 RelativePath="..\BasicCompiler_Common\Variable.h"1507 >1508 </File>1509 <Filter1510 Name="Prototype"1511 >1512 <File1513 RelativePath="..\BasicCompiler_Common\include\Member.h"1514 >1515 </File>1516 <File1517 RelativePath="..\BasicCompiler_Common\include\Method.h"1518 >1519 </File>1520 <File1521 RelativePath="..\BasicCompiler_Common\include\Prototype.h"1522 >1523 </File>1524 </Filter>1525 </Filter>1526 <Filter1527 Name="Lexical Parts"1528 >1529 <File1530 RelativePath="..\BasicCompiler_Common\include\Source.h"1531 >1532 </File>1533 </Filter>1534 <Filter1535 Name="Operation Statements"1536 >1537 <File1538 RelativePath="..\BasicCompiler_Common\include\Exception.h"1539 >1540 </File>1541 </Filter>1542 <Filter1543 Name="Module"1544 >1545 <File1546 RelativePath="..\BasicCompiler_Common\include\ObjectModule.h"1547 >1548 </File>1549 </Filter>1550 1374 </Filter> 1551 1375 </Filter> -
trunk/abdev/BasicCompiler32/Compile_Calc.cpp
r179 r183 1 #include <jenga/include/smoothie/Smoothie.h> 2 #include <jenga/include/smoothie/LexicalAnalysis.h> 3 1 4 #include "../BasicCompiler_Common/common.h" 2 5 #include "Opcode.h" … … 78 81 //符号あり 79 82 80 if(OldType==DEF_INTEGER || ( isUnicode&&OldType==DEF_CHAR)){83 if(OldType==DEF_INTEGER || (Smoothie::IsUnicode()&&OldType==DEF_CHAR)){ 81 84 //pop eax 82 85 op_pop(REG_EAX); … … 90 93 op_push(REG_EAX); 91 94 } 92 else if(OldType==DEF_SBYTE || ( isUnicode==false&&OldType==DEF_CHAR)){95 else if(OldType==DEF_SBYTE || (Smoothie::IsUnicode()==false&&OldType==DEF_CHAR)){ 93 96 //pop eax 94 97 op_pop(REG_EAX); … … 170 173 //符号あり 171 174 172 if(OldType==DEF_INTEGER || ( isUnicode&&OldType==DEF_CHAR)){175 if(OldType==DEF_INTEGER || (Smoothie::IsUnicode()&&OldType==DEF_CHAR)){ 173 176 //pop eax 174 177 op_pop(REG_EAX); … … 182 185 op_push(REG_EAX); 183 186 } 184 else if(OldType==DEF_SBYTE || ( isUnicode==false&&OldType==DEF_CHAR)){187 else if(OldType==DEF_SBYTE || (Smoothie::IsUnicode()==false&&OldType==DEF_CHAR)){ 185 188 //pop eax 186 189 op_pop(REG_EAX); … … 304 307 if(OldType==DEF_BOOLEAN|| 305 308 OldType==DEF_BYTE|| 306 OldType==DEF_WORD||OldType==DEF_INTEGER || ( isUnicode&&OldType==DEF_CHAR)) return;307 else if(OldType==DEF_SBYTE || ( isUnicode==false&&OldType==DEF_CHAR)){309 OldType==DEF_WORD||OldType==DEF_INTEGER || (Smoothie::IsUnicode()&&OldType==DEF_CHAR)) return; 310 else if(OldType==DEF_SBYTE || (Smoothie::IsUnicode()==false&&OldType==DEF_CHAR)){ 308 311 //pop eax 309 312 op_pop(REG_EAX); … … 334 337 void ChangeTypeToByte(int OldType){ 335 338 //現在のスタックの内容をbyte型に変換する 336 if(OldType==DEF_BYTE||OldType==DEF_SBYTE || ( isUnicode==false&&OldType==DEF_CHAR)) return;339 if(OldType==DEF_BYTE||OldType==DEF_SBYTE || (Smoothie::IsUnicode()==false&&OldType==DEF_CHAR)) return; 337 340 338 341 ChangeTypeToLong(OldType); … … 619 622 620 623 621 if( varType.IsObject() && Smoothie:: meta.blittableTypes.IsExist( calcType ) ){624 if( varType.IsObject() && Smoothie::GetMeta().blittableTypes.IsExist( calcType ) ){ 622 625 // Blittable型をオブジェクトとして扱う 623 626 vector<UserProc *> userProcs; 624 Smoothie:: meta.blittableTypes.GetClass( calcType ).GetStaticMethods().Enum( "_Create", userProcs );627 Smoothie::GetMeta().blittableTypes.GetClass( calcType ).GetStaticMethods().Enum( "_Create", userProcs ); 625 628 if( userProcs.size() != 1 ){ 626 629 SetError(); -
trunk/abdev/BasicCompiler32/Compile_CallProc.cpp
r137 r183 1 #include <jenga/include/smoothie/Smoothie.h> 2 1 3 #include "../BasicCompiler_Common/common.h" 2 4 #include "Opcode.h" … … 119 121 if(lstrcmpi(ObjectName,"Super")==0){ 120 122 //クラスメンバ関数内から基底クラスの呼び出し 121 pobj_c= pobj_CompilingClass;123 pobj_c=Smoothie::Temp::pCompilingClass; 122 124 } 123 125 else{ … … 127 129 pobj_c = &varType.GetClass(); 128 130 if( NATURAL_TYPE( varType.GetBasicType() ) != DEF_OBJECT ){ 129 pobj_c= pobj_DBClass->Find(ObjectName);131 pobj_c=Smoothie::GetMeta().GetClasses().Find(ObjectName); 130 132 if( pobj_c ){ 131 133 isStatic = true; … … 144 146 else{ 145 147 //クラスメンバ関数内から同一クラスのメンバ関数の呼び出し 146 pobj_c= pobj_CompilingClass;148 pobj_c=Smoothie::Temp::pCompilingClass; 147 149 } 148 150 } … … 173 175 if(ObjectName[0]){ 174 176 //外部からの呼び出し 175 if(pobj_c== pobj_CompilingClass){177 if(pobj_c==Smoothie::Temp::pCompilingClass){ 176 178 //同一クラスオブジェクトの場合はプライベートアクセスを容認する 177 179 if( pMethod->IsNoneAccess() ){ -
trunk/abdev/BasicCompiler32/Compile_Func.cpp
r159 r183 1 #include <jenga/include/smoothie/Smoothie.h> 2 1 3 #include "../BasicCompiler_Common/common.h" 2 4 #include "Opcode.h" … … 176 178 tempParm=temp2; 177 179 178 type.SetType( DEF_OBJECT, pobj_DBClass->GetStringClassPtr() );180 type.SetType( DEF_OBJECT, Smoothie::GetMeta().GetClasses().GetStringClassPtr() ); 179 181 } 180 182 … … 228 230 229 231 //オーバーロードを解決 230 pUserProc=OverloadSolution(name,subs,Smoothie:: meta.procPointers[ProcPtr_BaseIndex]->Params(), Type() );232 pUserProc=OverloadSolution(name,subs,Smoothie::GetMeta().GetProcPointers()[ProcPtr_BaseIndex]->Params(), Type() ); 231 233 232 234 if(!pUserProc){ … … 280 282 SetThisPtrToReg(REG_RCX); 281 283 282 pobj_c= pobj_CompilingClass;284 pobj_c=Smoothie::Temp::pCompilingClass; 283 285 } 284 286 -
trunk/abdev/BasicCompiler32/Compile_ProcOp.cpp
r143 r183 1 #include <jenga/include/smoothie/Smoothie.h> 2 #include <jenga/include/smoothie/LexicalAnalysis.h> 3 4 #include <Program.h> 5 #include <LexicalScopingImpl.h> 6 #include <ClassImpl.h> 7 1 8 #include "../BasicCompiler_Common/common.h" 2 9 #include "Opcode.h" … … 48 55 49 56 //クラスに属する静的メンバを定義 50 CMember::InitStaticMember();57 Smoothie::GetMeta().GetClasses().InitStaticMember(); 51 58 52 59 GetGlobalDataForDll(); … … 61 68 //静的ローカルオブジェクトのコンストラクタ呼び出し 62 69 63 foreach( Variable *pVar, globalVars ){70 BOOST_FOREACH( Variable *pVar, globalVars ){ 64 71 if(memicmp(pVar->GetName().c_str(),"Static%",7)==0){ 65 72 //コンストラクタ呼び出し … … 87 94 UserProc::CompileStartForGlobalArea(); 88 95 89 obj_LexScopes.CallDestructorsOfScopeEnd();96 GetLexicalScopes().CallDestructorsOfScopeEnd(); 90 97 91 98 UserProc::CompileStartForUserProc( pBackUserProc ); … … 217 224 && userProc.GetParentClass().GetName() == "_System_TypeBase" ){ 218 225 219 pobj_DBClass->Compile_System_InitializeUserTypes();226 Smoothie::GetMeta().GetClasses().Compile_System_InitializeUserTypes(); 220 227 } 221 228 else if( userProc.GetName() == "RegisterGlobalRoots" … … 263 270 264 271 //コンパイル中の関数が属するクラス 265 pobj_CompilingClass=pUserProc->GetParentClassPtr();272 Smoothie::Temp::pCompilingClass=pUserProc->GetParentClassPtr(); 266 273 267 274 //コンパイルスタートをクラス管理クラスに追加 268 pobj_DBClass->StartCompile( pUserProc );275 Smoothie::GetMeta().GetClasses().StartCompile( pUserProc ); 269 276 270 277 //コンパイル中の関数 … … 272 279 273 280 // コンパイル中の関数が属する名前空間 274 Smoothie:: Lexical::liveingNamespaceScopes = pUserProc->GetNamespaceScopes();281 Smoothie::Temp::liveingNamespaceScopes = pUserProc->GetNamespaceScopes(); 275 282 276 283 // コンパイル中の関数でImportsされている名前空間 … … 335 342 336 343 //レキシカルスコープ情報 337 pVar->ScopeLevel= obj_LexScopes.GetNowLevel();338 pVar->ScopeStartAddress= obj_LexScopes.GetStartAddress();344 pVar->ScopeLevel=GetLexicalScopes().GetNowLevel(); 345 pVar->ScopeStartAddress=GetLexicalScopes().GetStartAddress(); 339 346 pVar->bLiving=TRUE; 340 347 … … 450 457 } 451 458 452 if( pobj_CompilingClass){453 if( pUserProc->GetName() == pobj_CompilingClass->GetName() ){459 if(Smoothie::Temp::pCompilingClass){ 460 if( pUserProc->GetName() == Smoothie::Temp::pCompilingClass->GetName() ){ 454 461 //////////////////////////////////// 455 462 // コンストラクタをコンパイルするとき … … 457 464 458 465 //コンストラクタのコンパイル開始を通知 459 pobj_CompilingClass->NotifyStartConstructorCompile();466 Smoothie::Temp::pCompilingClass->NotifyStartConstructorCompile(); 460 467 461 468 //基底クラスかどうかの識別 462 469 //(継承元がインターフェイスの場合も基底クラスと見なす) 463 470 BOOL bThisIsSuperClass; 464 if( pobj_CompilingClass->pobj_InheritsClass==0) bThisIsSuperClass=1;465 else if( pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod() == NULL ){471 if(Smoothie::Temp::pCompilingClass->pobj_InheritsClass==0) bThisIsSuperClass=1; 472 else if( Smoothie::Temp::pCompilingClass->pobj_InheritsClass->GetConstructorMethod() == NULL ){ 466 473 //インターフェイスを継承したときはコンストラクタを持たない 467 474 bThisIsSuperClass=1; … … 482 489 temporary[i4]=basbuf[i3]; 483 490 } 484 if( pobj_CompilingClass->pobj_InheritsClass->GetName() == temporary ){491 if( Smoothie::Temp::pCompilingClass->pobj_InheritsClass->GetName() == temporary ){ 485 492 //基底クラスのコンストラクタを呼び出す 486 493 cp=i3; … … 499 506 Type dummyType; 500 507 CallProc( PROC_DEFAULT 501 , pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod()->pUserProc502 , pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod()->pUserProc->GetName().c_str()508 , Smoothie::Temp::pCompilingClass->pobj_InheritsClass->GetConstructorMethod()->pUserProc 509 , Smoothie::Temp::pCompilingClass->pobj_InheritsClass->GetConstructorMethod()->pUserProc->GetName().c_str() 503 510 , temporary 504 511 , dummyType ); … … 507 514 //基底クラスのコンストラクタを暗黙的に呼び出す 508 515 Opcode_CallProc("", 509 pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod()->pUserProc,516 Smoothie::Temp::pCompilingClass->pobj_InheritsClass->GetConstructorMethod()->pUserProc, 510 517 0, 511 518 "", … … 515 522 516 523 //仮想関数テーブルを初期化 517 if( pobj_CompilingClass->IsExistVirtualFunctions()518 && ! pobj_CompilingClass->IsAbstract() ){524 if( Smoothie::Temp::pCompilingClass->IsExistVirtualFunctions() 525 && !Smoothie::Temp::pCompilingClass->IsAbstract() ){ 519 526 //関数テーブルに値をセット 520 int offset = (int) pobj_CompilingClass->GetVtblGlobalOffset();527 int offset = (int)Smoothie::Temp::pCompilingClass->GetVtblGlobalOffset(); 521 528 522 529 //mov eax,offset … … 538 545 539 546 //デストラクタのコンパイル開始を通知 540 pobj_CompilingClass->NotifyStartDestructorCompile();547 Smoothie::Temp::pCompilingClass->NotifyStartDestructorCompile(); 541 548 } 542 549 } … … 564 571 ////////////////////////////////////////// 565 572 566 if( pobj_CompilingClass ){567 568 if( pobj_CompilingClass->IsCompilingConstructor() ){573 if( Smoothie::Temp::pCompilingClass ){ 574 575 if( Smoothie::Temp::pCompilingClass->IsCompilingConstructor() ){ 569 576 // コンストラクタをコンパイルしていたとき 570 577 571 578 // コンストラクタのコンパイルが完了したことを通知 572 pobj_CompilingClass->NotifyFinishConstructorCompile();579 Smoothie::Temp::pCompilingClass->NotifyFinishConstructorCompile(); 573 580 } 574 581 else if( pUserProc->IsDestructor() ){ … … 578 585 579 586 // デストラクタのコンパイルが完了したことを通知 580 pobj_CompilingClass->NotifyFinishDestructorCompile();581 582 if( pobj_CompilingClass->pobj_InheritsClass){587 Smoothie::Temp::pCompilingClass->NotifyFinishDestructorCompile(); 588 589 if(Smoothie::Temp::pCompilingClass->pobj_InheritsClass){ 583 590 /* サブクラスのデストラクタをコンパイルしているときは、 584 591 基底クラスのデストラクタを呼び出す */ 585 592 586 const CMethod *method = pobj_CompilingClass->pobj_InheritsClass->GetDestructorMethod();593 const CMethod *method = Smoothie::Temp::pCompilingClass->pobj_InheritsClass->GetDestructorMethod(); 587 594 if( method ){ 588 595 Opcode_CallProc("", … … 627 634 628 635 //ローカルオブジェクトの解放処理 629 obj_LexScopes.CallDestructorsOfScopeEnd();636 GetLexicalScopes().CallDestructorsOfScopeEnd(); 630 637 631 638 //プロシージャ抜け出しスケジュール(Exit Sub/Function) … … 702 709 obp+=sizeof(long); 703 710 } 704 else if(i3==DEF_INTEGER||i3==DEF_WORD || ( isUnicode&&i3==DEF_CHAR)){711 else if(i3==DEF_INTEGER||i3==DEF_WORD || (Smoothie::IsUnicode()&&i3==DEF_CHAR)){ 705 712 //xor eax,eax(eaxを0に初期化する) 706 713 op_zero_reg(REG_EAX); … … 714 721 obp+=sizeof(long); 715 722 } 716 else if(i3==DEF_SBYTE||i3==DEF_BYTE||i3==DEF_BOOLEAN || ( isUnicode==false&&i3==DEF_CHAR)){723 else if(i3==DEF_SBYTE||i3==DEF_BYTE||i3==DEF_BOOLEAN || (Smoothie::IsUnicode()==false&&i3==DEF_CHAR)){ 717 724 //xor eax,eax(eaxを0に初期化する) 718 725 op_zero_reg(REG_EAX); … … 732 739 } 733 740 HeapDefaultFree(pLocalVarAddrSchedule); 734 foreach( Variable *pVar, pUserProc->localVars ){741 BOOST_FOREACH( Variable *pVar, pUserProc->localVars ){ 735 742 //後にデバッグで利用する 736 743 pVar->offset = AllLocalVarSize - pVar->offset; -
trunk/abdev/BasicCompiler32/Compile_Set_Var.cpp
r121 r183 1 #include <jenga/include/smoothie/Smoothie.h> 2 1 3 #include "../BasicCompiler_Common/common.h" 2 4 #include "Opcode.h" … … 213 215 } 214 216 void ExtendTypeTo32(int type,int reg){ 215 if(type==DEF_INTEGER || ( isUnicode&&type==DEF_CHAR)){217 if(type==DEF_INTEGER || (Smoothie::IsUnicode()&&type==DEF_CHAR)){ 216 218 //movsx reg32,reg16 217 219 op_movsx_R32R16(reg,reg); … … 221 223 op_and_RV(reg,(int)0x0000FFFF); 222 224 } 223 else if(type==DEF_SBYTE || ( isUnicode==false&&type==DEF_CHAR)){225 else if(type==DEF_SBYTE || (Smoothie::IsUnicode()==false&&type==DEF_CHAR)){ 224 226 //movsx reg32,reg8 225 227 op_movsx_R32R8(reg,reg); … … 231 233 } 232 234 void ExtendTypeTo16(int type,int reg){ 233 if(type==DEF_SBYTE || ( isUnicode==false&&type==DEF_CHAR)){235 if(type==DEF_SBYTE || (Smoothie::IsUnicode()==false&&type==DEF_CHAR)){ 234 236 //movsx reg16,reg8 235 237 op_movsx_R16R8(reg,reg); -
trunk/abdev/BasicCompiler32/Compile_Statement.cpp
r142 r183 1 #include <jenga/include/smoothie/LexicalAnalysis.h> 2 3 #include <LexicalScopingImpl.h> 4 #include <Compiler.h> 5 1 6 #include "../BasicCompiler_Common/common.h" 2 7 #include "Opcode.h" … … 274 279 275 280 //レキシカルスコープをレベルアップ 276 obj_LexScopes.Start( obp, SCOPE_TYPE_IF );281 GetLexicalScopes().Start( obp, SCOPE_TYPE_IF ); 277 282 278 283 i2=CompileBuffer(ESC_ENDIF,0); 279 284 280 285 //レキシカルスコープをレベルダウン 281 obj_LexScopes.End();286 GetLexicalScopes().End(); 282 287 283 288 … … 299 304 300 305 //レキシカルスコープをレベルアップ 301 obj_LexScopes.Start( obp, SCOPE_TYPE_IF );306 GetLexicalScopes().Start( obp, SCOPE_TYPE_IF ); 302 307 303 308 CompileBuffer(ESC_ENDIF,0); 304 309 305 310 //レキシカルスコープをレベルダウン 306 obj_LexScopes.End();311 GetLexicalScopes().End(); 307 312 308 313 … … 525 530 526 531 //レキシカルスコープをレベルアップ 527 obj_LexScopes.Start( obp, SCOPE_TYPE_WHILE );532 GetLexicalScopes().Start( obp, SCOPE_TYPE_WHILE ); 528 533 529 534 //While内をコンパイル 530 535 CompileBuffer(0,COM_WEND); 531 536 532 obj_LexScopes.CallDestructorsOfScopeEnd();537 GetLexicalScopes().CallDestructorsOfScopeEnd(); 533 538 534 539 if( i3 == -1 ){ … … 542 547 543 548 //レキシカルスコープをレベルダウン 544 obj_LexScopes.End();549 GetLexicalScopes().End(); 545 550 546 551 *((long *)(OpBuffer+je_schedule-sizeof(long)))=obp-je_schedule; //jeジャンプ先のオフセット値 … … 660 665 661 666 //レキシカルスコープをレベルアップ 662 obj_LexScopes.Start( obp, SCOPE_TYPE_FOR );667 GetLexicalScopes().Start( obp, SCOPE_TYPE_FOR ); 663 668 664 669 //For内をコンパイル 665 670 CompileBuffer(0,COM_NEXT); 666 671 667 obj_LexScopes.CallDestructorsOfScopeEnd();672 GetLexicalScopes().CallDestructorsOfScopeEnd(); 668 673 669 674 if(szNextVariable[0]){ … … 679 684 680 685 //レキシカルスコープをレベルダウン 681 obj_LexScopes.End();686 GetLexicalScopes().End(); 682 687 683 688 *((long *)(OpBuffer+je_schedule))=obp-(je_schedule+sizeof(long)); //jeジャンプ先のオフセット値 … … 700 705 701 706 //レキシカルスコープをレベルアップ 702 obj_LexScopes.Start( obp, SCOPE_TYPE_DO );707 GetLexicalScopes().Start( obp, SCOPE_TYPE_DO ); 703 708 704 709 //Do内をコンパイル 705 710 CompileBuffer(0,COM_LOOP); 706 711 707 obj_LexScopes.CallDestructorsOfScopeEnd();712 GetLexicalScopes().CallDestructorsOfScopeEnd(); 708 713 709 714 extern char *basbuf; … … 908 913 909 914 //レキシカルスコープをレベルダウン 910 obj_LexScopes.End();915 GetLexicalScopes().End(); 911 916 912 917 *((long *)(OpBuffer+je_schedule))=obp-(je_schedule+sizeof(long)); //jmpジャンプ先のオフセット値 … … 942 947 943 948 //未解放のローカルオブジェクトのデストラクタを呼び出す 944 obj_LexScopes.CallDestructorsOfReturn();949 GetLexicalScopes().CallDestructorsOfReturn(); 945 950 946 951 //jmp ...(End Sub/Function) … … 1217 1222 1218 1223 //レキシカルスコープをレベルアップ 1219 obj_LexScopes.Start( obp, SCOPE_TYPE_SELECT );1224 GetLexicalScopes().Start( obp, SCOPE_TYPE_SELECT ); 1220 1225 1221 1226 //Select Case内をコンパイル … … 1234 1239 1235 1240 //レキシカルスコープをレベルダウン 1236 obj_LexScopes.End();1241 GetLexicalScopes().End(); 1237 1242 1238 1243 pCaseSchedule=temp_pCaseSchedule; -
trunk/abdev/BasicCompiler32/Compile_Var.cpp
r159 r183 1 #include <jenga/include/smoothie/Smoothie.h> 2 #include <jenga/include/smoothie/LexicalAnalysis.h> 3 4 #include <LexicalScopingImpl.h> 5 #include <CodeGenerator.h> 6 #include <Compiler.h> 7 1 8 #include "../BasicCompiler_Common/common.h" 2 9 #include "Opcode.h" … … 187 194 188 195 //アクセシビリティをチェック 189 if(&objClass== pobj_CompilingClass){196 if(&objClass==Smoothie::Temp::pCompilingClass){ 190 197 //同一クラスオブジェクトの場合はプライベートアクセスを容認する 191 198 if(pMember->IsNoneAccess()){ … … 360 367 // 名前空間を分離 361 368 char namespaceStr[VN_SIZE]="", simpleName[VN_SIZE]; 362 Smoothie:: meta.namespaceScopesCollection.SplitNamespace( variable, namespaceStr, simpleName );369 Smoothie::GetMeta().namespaceScopesCollection.SplitNamespace( variable, namespaceStr, simpleName ); 363 370 364 371 // 先頭オブジェクトまたはクラス名と入れ子メンバに分割 … … 417 424 } 418 425 419 if( pobj_CompilingClass){426 if(Smoothie::Temp::pCompilingClass){ 420 427 ////////////////////// 421 428 // クラスメンバの参照 … … 430 437 pRelativeVar->dwKind=VAR_DIRECTMEM; 431 438 432 resultType.SetType( DEF_OBJECT, pobj_CompilingClass );439 resultType.SetType( DEF_OBJECT, Smoothie::Temp::pCompilingClass ); 433 440 return true; 434 441 } … … 443 450 444 451 bool isFound = false; 445 BOOST_FOREACH( CMember *pMember, pobj_CompilingClass->GetDynamicMembers() ){452 BOOST_FOREACH( CMember *pMember, Smoothie::Temp::pCompilingClass->GetDynamicMembers() ){ 446 453 if( pMember->GetName() == VarName ){ 447 454 isFound = true; … … 454 461 //Const修飾子のメソッド内でメンバ書き込みアクセスが発生したとき 455 462 //(コンストラクタ、デストラクタ内を除く) 456 const CMethod *pMethod = pobj_DBClass->GetNowCompilingMethodInfo();463 const CMethod *pMethod = Smoothie::GetMeta().GetClasses().GetNowCompilingMethodInfo(); 457 464 if( isWriteAccess && 458 465 pMethod->IsConst() && 459 pobj_CompilingClass->IsCompilingConstructor() == false &&460 pobj_CompilingClass->IsCompilingDestructor() == false466 Smoothie::Temp::pCompilingClass->IsCompilingConstructor() == false && 467 Smoothie::Temp::pCompilingClass->IsCompilingDestructor() == false 461 468 ){ 462 469 SetError(131, NULL, cp ); … … 473 480 isErrorEnabled, 474 481 isWriteAccess, 475 * pobj_CompilingClass,482 *Smoothie::Temp::pCompilingClass, 476 483 variable, 477 484 pRelativeVar, … … 517 524 } 518 525 519 int typeDefIndex = Smoothie:: meta.typeDefs.GetIndex( VarName );526 int typeDefIndex = Smoothie::GetMeta().typeDefs.GetIndex( VarName ); 520 527 if( typeDefIndex != -1 ){ 521 528 // TypeDef後の型名だったとき 522 lstrcpy( VarName, Smoothie:: meta.typeDefs[typeDefIndex].GetBaseName().c_str() );529 lstrcpy( VarName, Smoothie::GetMeta().typeDefs[typeDefIndex].GetBaseName().c_str() ); 523 530 } 524 531 … … 533 540 } 534 541 535 if( pobj_CompilingClass){542 if(Smoothie::Temp::pCompilingClass){ 536 543 //自身のクラスから静的メンバを参照する場合 537 544 char temp2[VN_SIZE]; 538 sprintf(temp2,"%s.%s", pobj_CompilingClass->GetName().c_str(),VarName);545 sprintf(temp2,"%s.%s",Smoothie::Temp::pCompilingClass->GetName().c_str(),VarName); 539 546 pVar = globalVars.Find( Symbol( temp2 ) ); 540 547 if( pVar ){ … … 825 832 char *temp; 826 833 temp=(char *)i64data; 827 i2= dataTable.AddString(temp,lstrlen(temp));834 i2=Compiler::GetNativeCode().GetDataTable().AddString(temp,lstrlen(temp)); 828 835 HeapDefaultFree(temp); 829 836 … … 1015 1022 char *temp; 1016 1023 temp=(char *)i64data; 1017 i2= dataTable.AddString(temp,lstrlen(temp));1024 i2=Compiler::GetNativeCode().GetDataTable().AddString(temp,lstrlen(temp)); 1018 1025 HeapDefaultFree(temp); 1019 1026 … … 1099 1106 1100 1107 //レキシカルスコープ 1101 pVar->ScopeLevel= obj_LexScopes.GetNowLevel();1102 pVar->ScopeStartAddress= obj_LexScopes.GetStartAddress();1108 pVar->ScopeLevel=GetLexicalScopes().GetNowLevel(); 1109 pVar->ScopeStartAddress=GetLexicalScopes().GetStartAddress(); 1103 1110 pVar->bLiving=TRUE; 1104 1111 … … 1134 1141 1135 1142 //レキシカルスコープ 1136 pVar->ScopeLevel= obj_LexScopes.GetNowLevel();1137 pVar->ScopeStartAddress= obj_LexScopes.GetStartAddress();1143 pVar->ScopeLevel=GetLexicalScopes().GetNowLevel(); 1144 pVar->ScopeStartAddress=GetLexicalScopes().GetStartAddress(); 1138 1145 pVar->bLiving=TRUE; 1139 1146 -
trunk/abdev/BasicCompiler32/MakePeHdr.cpp
r165 r183 1 1 #include <jenga/include/common/Environment.h> 2 3 #include <jenga/include/smoothie/Smoothie.h> 4 5 #include <LexicalScopingImpl.h> 6 #include <ClassImpl.h> 7 #include <Compiler.h> 2 8 3 9 #include "../BasicCompiler_Common/common.h" … … 134 140 ////////////////// 135 141 // データテーブル 136 dataTable.Init();142 Compiler::GetNativeCode().GetDataTable().Init(); 137 143 if(bDebugCompile){ 138 dataTable.Add( (long)0x00000002 );144 Compiler::GetNativeCode().GetDataTable().Add( (long)0x00000002 ); 139 145 } 140 146 … … 160 166 161 167 //関数ポインタ情報を初期化 162 Smoothie:: meta.procPointers.clear();168 Smoothie::GetMeta().GetProcPointers().clear(); 163 169 164 170 // 名前空間情報を取得 165 171 NamespaceScopesCollection::CollectNamespaces( 166 172 Smoothie::Lexical::source.GetBuffer(), 167 Smoothie:: meta.namespaceScopesCollection173 Smoothie::GetMeta().namespaceScopesCollection 168 174 ); 169 175 … … 171 177 // GetSubInfo関数の中で参照されるオブジェクト名を事前に取得する。 172 178 // ※オブジェクトの内容までは取得しない 173 pobj_DBClass=new Classes(); 174 pobj_DBClass->InitNames(); 179 Smoothie::GetMeta().GetClasses().CollectClassesForNameOnly( Smoothie::Lexical::source ); 175 180 176 181 //TypeDef情報を初期化 177 Smoothie:: meta.typeDefs.Init();182 Smoothie::GetMeta().typeDefs.Init(); 178 183 179 184 //定数情報を取得 … … 181 186 182 187 //サブルーチン(ユーザー定義、DLL関数)の識別子、アドレスを取得 183 pobj_CompilingClass=0;188 Smoothie::Temp::pCompilingClass=0; 184 189 GetSubInfo(); 185 190 186 191 //クラス情報を取得(※注 - GetSubInfoの後に呼び出す) 187 pobj_DBClass->GetAllClassInfo();192 Smoothie::GetMeta().GetClasses().GetAllClassInfo(); 188 193 189 194 //コードと行番号の関係 … … 336 341 337 342 //レキシカルスコープ情報を初期化 338 obj_LexScopes.Init(obp);343 GetLexicalScopes().Init(obp); 339 344 340 345 … … 360 365 if(!bDll){ 361 366 // 名前空間が初期化されているかをチェック 362 if( Smoothie:: Lexical::liveingNamespaceScopes.size() ){367 if( Smoothie::Temp::liveingNamespaceScopes.size() ){ 363 368 SetError(); 364 369 } … … 405 410 406 411 //クラスに属する静的メンバを定義 407 CMember::InitStaticMember();412 Smoothie::GetMeta().GetClasses().InitStaticMember(); 408 413 409 414 //グローバル実行領域をコンパイル開始 … … 460 465 461 466 // 名前空間が正しく閉じられているかをチェック 462 if( Smoothie:: Lexical::liveingNamespaceScopes.size() ){467 if( Smoothie::Temp::liveingNamespaceScopes.size() ){ 463 468 SetError(63,NULL,-1); 464 469 } … … 792 797 //(デバッグ情報で利用される) 793 798 extern int AllInitGlobalVarSize; 794 foreach( Variable *pVar, globalVars ){799 BOOST_FOREACH( Variable *pVar, globalVars ){ 795 800 if(pVar->offset&0x80000000){ 796 801 pVar->offset=(pVar->offset&0x7FFFFFFF)+AllInitGlobalVarSize; … … 874 879 875 880 //データセクションのファイル上のサイズ 876 if( dataTable.GetSize()%FILE_ALIGNMENT) FileSize_DataSection=dataTable.GetSize()+(FILE_ALIGNMENT-dataTable.GetSize()%FILE_ALIGNMENT);877 else FileSize_DataSection= dataTable.GetSize();881 if(Compiler::GetNativeCode().GetDataTable().GetSize()%FILE_ALIGNMENT) FileSize_DataSection=Compiler::GetNativeCode().GetDataTable().GetSize()+(FILE_ALIGNMENT-Compiler::GetNativeCode().GetDataTable().GetSize()%FILE_ALIGNMENT); 882 else FileSize_DataSection=Compiler::GetNativeCode().GetDataTable().GetSize(); 878 883 if(FileSize_DataSection) bUse_DataSection=1; 879 884 else bUse_DataSection=0; … … 1066 1071 //////////////////////////////////////// 1067 1072 //仮想関数データテーブルスケジュール 1068 pobj_DBClass->ActionVtblSchedule(ImageBase,MemPos_CodeSection);1073 Smoothie::GetMeta().GetClasses().ActionVtblSchedule(ImageBase,MemPos_CodeSection); 1069 1074 1070 1075 … … 1601 1606 if(bUse_DataSection){ 1602 1607 //データ テーブル 1603 WriteFile(hFile, dataTable.GetPtr(),dataTable.GetSize(),(DWORD *)&i2,NULL);1608 WriteFile(hFile,Compiler::GetNativeCode().GetDataTable().GetPtr(),Compiler::GetNativeCode().GetDataTable().GetSize(),(DWORD *)&i2,NULL); 1604 1609 i+=i2; 1605 1610 } … … 1713 1718 1714 1719 //クラスに関するメモリを解放 1715 delete pobj_DBClass; 1716 pobj_DBClass=0; 1720 Smoothie::GetMeta().GetClasses().Clear(); 1717 1721 } -
trunk/abdev/BasicCompiler32/NumOpe.cpp
r159 r183 1 #include <jenga/include/smoothie/Smoothie.h> 2 #include <jenga/include/smoothie/LexicalAnalysis.h> 3 4 #include <Compiler.h> 5 1 6 #include "../BasicCompiler_Common/common.h" 2 7 #include "Opcode.h" … … 39 44 op_push(REG_EAX); 40 45 } 41 else if(type==DEF_INTEGER || ( isUnicode&&type==DEF_CHAR)){46 else if(type==DEF_INTEGER || (Smoothie::IsUnicode()&&type==DEF_CHAR)){ 42 47 //movsx ebx,ax 43 48 OpBuffer[obp++]=(char)0x0F; … … 48 53 op_push(REG_EBX); 49 54 } 50 else if(type==DEF_SBYTE || ( isUnicode==false&&type==DEF_CHAR)){55 else if(type==DEF_SBYTE || (Smoothie::IsUnicode()==false&&type==DEF_CHAR)){ 51 56 //movsx ebx,al 52 57 OpBuffer[obp++]=(char)0x0F; … … 77 82 SetStringQuotes( parameter ); 78 83 79 Operator_New( * pobj_DBClass->GetStringClassPtr(), "", parameter, Type( DEF_OBJECT, *pobj_DBClass->GetStringClassPtr() ) );84 Operator_New( *Smoothie::GetMeta().GetClasses().GetStringClassPtr(), "", parameter, Type( DEF_OBJECT, *Smoothie::GetMeta().GetClasses().GetStringClassPtr() ) ); 80 85 81 86 free( parameter ); … … 244 249 char member[VN_SIZE]; 245 250 CClass::RefType refType; 246 if( SplitMemberName( termFull, termLeft, member, refType ) ){251 if( CClass::SplitName( termFull, termLeft, member, refType ) ){ 247 252 /////////////////////////////////////////////////////////////////// 248 253 // オブジェクトとメンバに分解できるとき … … 256 261 Type leftType; 257 262 if( GetTermType( termLeft, leftType, isLiteral, &isClassName ) ){ 258 if( isClassName == false && Smoothie:: meta.blittableTypes.IsExist( leftType ) ){263 if( isClassName == false && Smoothie::GetMeta().blittableTypes.IsExist( leftType ) ){ 259 264 // 左側のオブジェクト部分がBlittable型のとき 260 265 … … 262 267 lstrcpy( temporary, termLeft ); 263 268 sprintf( termLeft, "%s(%s)", 264 Smoothie:: meta.blittableTypes.Find( leftType ).GetCreateStaticMethodFullName().c_str(),269 Smoothie::GetMeta().blittableTypes.Find( leftType ).GetCreateStaticMethodFullName().c_str(), 265 270 temporary ); 266 271 } … … 291 296 292 297 if( pIsClassName ){ 293 if( pobj_DBClass->Find( termFull ) ){298 if( Smoothie::GetMeta().GetClasses().Find( termFull ) ){ 294 299 *pIsClassName = true; 295 300 return true; … … 307 312 if(lstrcmpi(termFull,"This")==0 && isProcedureCallOnly == false ){ 308 313 //Thisオブジェクト 309 resultType.SetType( DEF_OBJECT, pobj_CompilingClass );314 resultType.SetType( DEF_OBJECT, Smoothie::Temp::pCompilingClass ); 310 315 311 316 SetThisPtrToReg( useReg ); … … 588 593 } 589 594 590 i2 = dataTable.AddBinary( binary, num * tempBaseType.GetSize() );595 i2 = Compiler::GetNativeCode().GetDataTable().AddBinary( binary, num * tempBaseType.GetSize() ); 591 596 592 597 //mov eax,i2 … … 735 740 736 741 type_stack[sp]=DEF_OBJECT; 737 index_stack[sp]=(LONG_PTR) pobj_DBClass->GetStringClassPtr();742 index_stack[sp]=(LONG_PTR)Smoothie::GetMeta().GetClasses().GetStringClassPtr(); 738 743 bLiteralCalculation=0; 739 744 … … 746 751 bLiteralCalculation=0; 747 752 748 i2= dataTable.AddString(term,i3);753 i2=Compiler::GetNativeCode().GetDataTable().AddString(term,i3); 749 754 750 755 //push DataSize … … 833 838 } 834 839 else{ 835 index_stack[sp] = (LONG_PTR) pobj_DBClass->GetObjectClassPtr();840 index_stack[sp] = (LONG_PTR)Smoothie::GetMeta().GetClasses().GetObjectClassPtr(); 836 841 } 837 842 -
trunk/abdev/BasicCompiler32/NumOpe_TypeOperation.cpp
r67 r183 1 #include <jenga/include/smoothie/Smoothie.h> 2 3 #include <Compiler.h> 4 1 5 #include "../BasicCompiler_Common/common.h" 2 6 #include "Opcode.h" … … 51 55 op_push(REG_EAX); 52 56 } 53 else if(type==DEF_INTEGER || ( isUnicode&&type==DEF_CHAR)){57 else if(type==DEF_INTEGER || (Smoothie::IsUnicode()&&type==DEF_CHAR)){ 54 58 //pop eax 55 59 op_pop(REG_EAX); … … 75 79 op_push(REG_EAX); 76 80 } 77 else if(type==DEF_SBYTE || ( isUnicode==false&&type==DEF_CHAR)){81 else if(type==DEF_SBYTE || (Smoothie::IsUnicode()==false&&type==DEF_CHAR)){ 78 82 //pop eax 79 83 op_pop(REG_EAX); … … 101 105 } 102 106 void ExtendStackTo16(int type){ 103 if(type==DEF_SBYTE || ( isUnicode==false&&type==DEF_CHAR)){107 if(type==DEF_SBYTE || (Smoothie::IsUnicode()==false&&type==DEF_CHAR)){ 104 108 //pop eax 105 109 op_pop(REG_EAX); -
trunk/abdev/BasicCompiler64/BasicCompiler.vcproj
r169 r183 79 79 Name="VCLinkerTool" 80 80 AdditionalOptions="/MACHINE:AMD64" 81 AdditionalDependencies="comctl32.lib psapi.lib bufferoverflowu.lib commond.lib "81 AdditionalDependencies="comctl32.lib psapi.lib bufferoverflowu.lib commond.lib smoothied.lib" 82 82 OutputFile="../ActiveBasic/BasicCompiler64.exe" 83 83 LinkIncremental="2" … … 153 153 Optimization="2" 154 154 InlineFunctionExpansion="2" 155 EnableIntrinsicFunctions="true" 155 156 FavorSizeOrSpeed="1" 156 AdditionalIncludeDirectories="..\..\;..\..\cpplibs\ boost;..\BasicCompiler_Common\include"157 AdditionalIncludeDirectories="..\..\;..\..\cpplibs\STLPort;..\..\cpplibs\boost;..\BasicCompiler_Common\include" 157 158 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;JPN;_AMD64_;_WIN64" 158 159 MinimalRebuild="false" … … 187 188 Name="VCLinkerTool" 188 189 AdditionalOptions="/MACHINE:AMD64" 189 AdditionalDependencies="comctl32.lib psapi.lib bufferoverflowu.lib common.lib "190 AdditionalDependencies="comctl32.lib psapi.lib bufferoverflowu.lib common.lib smoothie.lib" 190 191 OutputFile="../ActiveBasic/BasicCompiler64.exe" 191 192 LinkIncremental="1" … … 275 276 </Filter> 276 277 <Filter 277 Name="Common Classes"278 >279 <File280 RelativePath="..\BasicCompiler_Common\include\Smoothie.h"281 >282 </File>283 <Filter284 Name="Meta Parts"285 >286 <File287 RelativePath="..\BasicCompiler_Common\include\Namespace.h"288 >289 </File>290 <File291 RelativePath="..\BasicCompiler_Common\Parameter.h"292 >293 </File>294 <File295 RelativePath="..\BasicCompiler_Common\Procedure.h"296 >297 </File>298 <File299 RelativePath="..\BasicCompiler_Common\include\Symbol.h"300 >301 </File>302 <File303 RelativePath="..\BasicCompiler_Common\Type.h"304 >305 </File>306 <File307 RelativePath="..\BasicCompiler_Common\TypeDef.h"308 >309 </File>310 <File311 RelativePath="..\BasicCompiler_Common\Variable.h"312 >313 </File>314 <Filter315 Name="Prototype"316 >317 <File318 RelativePath="..\BasicCompiler_Common\include\Class.h"319 >320 </File>321 <File322 RelativePath="..\BasicCompiler_Common\include\Member.h"323 >324 </File>325 <File326 RelativePath="..\BasicCompiler_Common\include\Method.h"327 >328 </File>329 <File330 RelativePath="..\BasicCompiler_Common\include\Prototype.h"331 >332 </File>333 </Filter>334 </Filter>335 <Filter336 Name="Lexical Parts"337 >338 <File339 RelativePath="..\BasicCompiler_Common\include\Source.h"340 >341 </File>342 </Filter>343 <Filter344 Name="Operation Statements"345 >346 <File347 RelativePath="..\BasicCompiler_Common\include\Exception.h"348 >349 </File>350 </Filter>351 <Filter352 Name="Module"353 >354 <File355 RelativePath="..\BasicCompiler_Common\include\ObjectModule.h"356 >357 </File>358 </Filter>359 </Filter>360 <Filter361 278 Name="Application Classes" 362 279 > 280 <File 281 RelativePath="..\BasicCompiler_Common\include\ClassImpl.h" 282 > 283 </File> 284 <File 285 RelativePath="..\BasicCompiler_Common\include\CodeGenerator.h" 286 > 287 </File> 288 <File 289 RelativePath="..\BasicCompiler_Common\include\Compiler.h" 290 > 291 </File> 292 <File 293 RelativePath="..\BasicCompiler_Common\include\DataTable.h" 294 > 295 </File> 296 <File 297 RelativePath="..\BasicCompiler_Common\include\Exception.h" 298 > 299 </File> 300 <File 301 RelativePath="..\BasicCompiler_Common\include\LexicalScopingImpl.h" 302 > 303 </File> 304 <File 305 RelativePath="..\BasicCompiler_Common\include\ProcedureImpl.h" 306 > 307 </File> 363 308 <File 364 309 RelativePath="..\BasicCompiler_Common\include\Program.h" … … 919 864 > 920 865 <File 921 RelativePath="..\BasicCompiler_Common\DataTable.cpp"922 >923 </File>924 <File925 RelativePath="..\BasicCompiler_Common\LoopRefCheck.cpp"926 >927 </File>928 <File929 866 RelativePath="..\BasicCompiler_Common\NonVolatile.cpp" 930 867 > … … 993 930 > 994 931 <File 995 RelativePath="..\BasicCompiler_Common\Class.cpp"996 >997 </File>998 <File999 RelativePath="..\BasicCompiler_Common\Class.h"1000 >1001 </File>1002 <File1003 932 RelativePath="..\BasicCompiler_Common\Enum.cpp" 1004 933 > … … 1022 951 </Filter> 1023 952 <Filter 1024 Name="LexicalScoping"1025 >1026 <File1027 RelativePath="..\BasicCompiler_Common\LexicalScoping.cpp"1028 >1029 </File>1030 <File1031 RelativePath="..\BasicCompiler_Common\LexicalScoping.h"1032 >1033 </File>1034 </Filter>1035 <Filter1036 953 Name="Constant" 1037 954 > … … 1066 983 <File 1067 984 RelativePath="..\BasicCompiler_Common\Subroutine.cpp" 1068 >1069 </File>1070 </Filter>1071 </Filter>1072 <Filter1073 Name="Common Classes"1074 >1075 <File1076 RelativePath="..\BasicCompiler_Common\src\Smoothie.cpp"1077 >1078 </File>1079 <Filter1080 Name="Meta Parts"1081 >1082 <File1083 RelativePath="..\BasicCompiler_Common\src\Member.cpp"1084 >1085 </File>1086 <File1087 RelativePath="..\BasicCompiler_Common\src\Method.cpp"1088 >1089 </File>1090 <File1091 RelativePath="..\BasicCompiler_Common\src\Namespace.cpp"1092 >1093 </File>1094 <File1095 RelativePath="..\BasicCompiler_Common\Procedure.cpp"1096 >1097 </File>1098 <File1099 RelativePath="..\BasicCompiler_Common\src\Prototype.cpp"1100 >1101 </File>1102 <File1103 RelativePath="..\BasicCompiler_Common\src\Symbol.cpp"1104 >1105 </File>1106 <File1107 RelativePath="..\BasicCompiler_Common\Type.cpp"1108 >1109 </File>1110 <File1111 RelativePath="..\BasicCompiler_Common\TypeDef.cpp"1112 >1113 </File>1114 <File1115 RelativePath="..\BasicCompiler_Common\Variable.cpp"1116 >1117 </File>1118 </Filter>1119 <Filter1120 Name="Lexical Parts"1121 >1122 <File1123 RelativePath="..\BasicCompiler_Common\src\Source.cpp"1124 >1125 </File>1126 </Filter>1127 <Filter1128 Name="Operation Statements"1129 >1130 <File1131 RelativePath="..\BasicCompiler_Common\src\Exception.cpp"1132 985 > 1133 986 </File> … … 1138 991 > 1139 992 <File 993 RelativePath="..\BasicCompiler_Common\src\ClassImpl.cpp" 994 > 995 </File> 996 <File 997 RelativePath="..\BasicCompiler_Common\src\CodeGenerator.cpp" 998 > 999 </File> 1000 <File 1001 RelativePath="..\BasicCompiler_Common\src\Compiler.cpp" 1002 > 1003 </File> 1004 <File 1005 RelativePath="..\BasicCompiler_Common\src\DataTable.cpp" 1006 > 1007 </File> 1008 <File 1009 RelativePath="..\BasicCompiler_Common\src\Exception.cpp" 1010 > 1011 </File> 1012 <File 1013 RelativePath="..\BasicCompiler_Common\src\LexicalScopingImpl.cpp" 1014 > 1015 </File> 1016 <File 1017 RelativePath="..\BasicCompiler_Common\src\ProcedureImpl.cpp" 1018 > 1019 </File> 1020 <File 1140 1021 RelativePath="..\BasicCompiler_Common\src\Program.cpp" 1022 > 1023 </File> 1024 <File 1025 RelativePath="..\BasicCompiler_Common\src\SmoothieImpl.cpp" 1141 1026 > 1142 1027 </File> -
trunk/abdev/BasicCompiler64/Compile_Calc.cpp
r159 r183 1 #include <jenga/include/smoothie/Smoothie.h> 2 #include <jenga/include/smoothie/LexicalAnalysis.h> 3 1 4 #include "../BasicCompiler_Common/common.h" 2 5 #include "Opcode.h" … … 227 230 } 228 231 229 if( varType.IsObject() && Smoothie:: meta.blittableTypes.IsExist( calcType ) ){232 if( varType.IsObject() && Smoothie::GetMeta().blittableTypes.IsExist( calcType ) ){ 230 233 // Blittable型をオブジェクトとして扱う 231 234 vector<UserProc *> userProcs; 232 Smoothie:: meta.blittableTypes.GetClass( calcType ).GetStaticMethods().Enum( "_Create", userProcs );235 Smoothie::GetMeta().blittableTypes.GetClass( calcType ).GetStaticMethods().Enum( "_Create", userProcs ); 233 236 if( userProcs.size() != 1 ){ 234 237 SetError(); -
trunk/abdev/BasicCompiler64/Compile_CallProc.cpp
r137 r183 1 #include <jenga/include/smoothie/Smoothie.h> 2 1 3 #include "../BasicCompiler_Common/common.h" 2 4 #include "Opcode.h" … … 124 126 if(lstrcmpi(ObjectName,"Super")==0){ 125 127 //クラスメンバ関数内から基底クラスの呼び出し 126 pobj_c= pobj_CompilingClass;128 pobj_c=Smoothie::Temp::pCompilingClass; 127 129 } 128 130 else{ … … 132 134 pobj_c = &varType.GetClass(); 133 135 if( NATURAL_TYPE( varType.GetBasicType() ) != DEF_OBJECT ){ 134 pobj_c= pobj_DBClass->Find(ObjectName);136 pobj_c=Smoothie::GetMeta().GetClasses().Find(ObjectName); 135 137 if( pobj_c ){ 136 138 isStatic = true; … … 149 151 else{ 150 152 //クラスメンバ関数内から同一クラスのメンバ関数の呼び出し 151 pobj_c= pobj_CompilingClass;153 pobj_c=Smoothie::Temp::pCompilingClass; 152 154 } 153 155 } … … 178 180 if(ObjectName[0]){ 179 181 //外部からの呼び出し 180 if(pobj_c== pobj_CompilingClass){182 if(pobj_c==Smoothie::Temp::pCompilingClass){ 181 183 //同一クラスオブジェクトの場合はプライベートアクセスを容認する 182 184 if( pMethod->IsNoneAccess() ){ -
trunk/abdev/BasicCompiler64/Compile_Func.cpp
r159 r183 1 #include <jenga/include/smoothie/Smoothie.h> 2 1 3 #include "../BasicCompiler_Common/common.h" 2 4 #include "Opcode.h" … … 30 32 tempParm=temp2; 31 33 32 type.SetType( DEF_OBJECT, pobj_DBClass->GetStringClassPtr() );34 type.SetType( DEF_OBJECT, Smoothie::GetMeta().GetClasses().GetStringClassPtr() ); 33 35 } 34 36 … … 78 80 79 81 //オーバーロードを解決 80 pUserProc=OverloadSolution(name,subs,Smoothie:: meta.procPointers[ProcPtr_BaseIndex]->Params(), Type() );82 pUserProc=OverloadSolution(name,subs,Smoothie::GetMeta().GetProcPointers()[ProcPtr_BaseIndex]->Params(), Type() ); 81 83 82 84 if(!pUserProc){ … … 127 129 SetThisPtrToReg(REG_RCX); 128 130 129 pobj_c= pobj_CompilingClass;131 pobj_c=Smoothie::Temp::pCompilingClass; 130 132 } 131 133 -
trunk/abdev/BasicCompiler64/Compile_ProcOp.cpp
r169 r183 1 #include <jenga/include/smoothie/Smoothie.h> 2 #include <jenga/include/smoothie/LexicalAnalysis.h> 3 1 4 #include <Program.h> 5 #include <LexicalScopingImpl.h> 6 #include <ClassImpl.h> 2 7 3 8 #include "../BasicCompiler_Common/common.h" … … 51 56 52 57 //クラスに属する静的メンバを定義 53 CMember::InitStaticMember();58 Smoothie::GetMeta().GetClasses().InitStaticMember(); 54 59 55 60 GetGlobalDataForDll(); … … 75 80 StackFrameSchedule=obp-sizeof(long); 76 81 77 foreach( Variable *pVar, globalVars ){82 BOOST_FOREACH( Variable *pVar, globalVars ){ 78 83 if(memicmp(pVar->GetName().c_str(),"Static%",7)==0){ 79 84 //コンストラクタ呼び出し … … 110 115 UserProc::CompileStartForGlobalArea(); 111 116 112 obj_LexScopes.CallDestructorsOfScopeEnd();117 GetLexicalScopes().CallDestructorsOfScopeEnd(); 113 118 114 119 UserProc::CompileStartForUserProc( pBackUserProc ); … … 210 215 && userProc.GetParentClass().GetName() == "_System_TypeBase" ){ 211 216 212 pobj_DBClass->Compile_System_InitializeUserTypes();217 Smoothie::GetMeta().GetClasses().Compile_System_InitializeUserTypes(); 213 218 } 214 219 else if( userProc.GetName() == "RegisterGlobalRoots" … … 255 260 256 261 //コンパイル中の関数が属するクラス 257 pobj_CompilingClass=pUserProc->GetParentClassPtr();262 Smoothie::Temp::pCompilingClass=pUserProc->GetParentClassPtr(); 258 263 259 264 //コンパイルスタートをクラス管理クラスに追加 260 pobj_DBClass->StartCompile( pUserProc );265 Smoothie::GetMeta().GetClasses().StartCompile( pUserProc ); 261 266 262 267 //コンパイル中の関数 … … 264 269 265 270 // コンパイル中の関数が属する名前空間 266 Smoothie:: Lexical::liveingNamespaceScopes = pUserProc->GetNamespaceScopes();271 Smoothie::Temp::liveingNamespaceScopes = pUserProc->GetNamespaceScopes(); 267 272 268 273 // コンパイル中の関数でImportsされている名前空間 … … 342 347 343 348 //レキシカルスコープ情報を初期化 344 obj_LexScopes.Init(obp);349 GetLexicalScopes().Init(obp); 345 350 346 351 … … 377 382 378 383 //レキシカルスコープ情報 379 pVar->ScopeLevel= obj_LexScopes.GetNowLevel();380 pVar->ScopeStartAddress= obj_LexScopes.GetStartAddress();384 pVar->ScopeLevel=GetLexicalScopes().GetNowLevel(); 385 pVar->ScopeStartAddress=GetLexicalScopes().GetStartAddress(); 381 386 pVar->bLiving=TRUE; 382 387 … … 504 509 } 505 510 506 if( pobj_CompilingClass){507 if( pUserProc->GetName() == pobj_CompilingClass->GetName() ){511 if(Smoothie::Temp::pCompilingClass){ 512 if( pUserProc->GetName() == Smoothie::Temp::pCompilingClass->GetName() ){ 508 513 //////////////////////////////////// 509 514 // コンストラクタをコンパイルするとき … … 511 516 512 517 //コンストラクタのコンパイル開始を通知 513 pobj_CompilingClass->NotifyStartConstructorCompile();518 Smoothie::Temp::pCompilingClass->NotifyStartConstructorCompile(); 514 519 515 520 //基底クラスかどうかの識別 516 521 //(継承元がインターフェイスの場合も基底クラスと見なす) 517 522 BOOL bThisIsSuperClass; 518 if( pobj_CompilingClass->pobj_InheritsClass==0) bThisIsSuperClass=1;519 else if( pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod() == NULL ){523 if(Smoothie::Temp::pCompilingClass->pobj_InheritsClass==0) bThisIsSuperClass=1; 524 else if( Smoothie::Temp::pCompilingClass->pobj_InheritsClass->GetConstructorMethod() == NULL ){ 520 525 //インターフェイスを継承したときはコンストラクタを持たない 521 526 bThisIsSuperClass=1; … … 536 541 temporary[i4]=basbuf[i3]; 537 542 } 538 if( pobj_CompilingClass->pobj_InheritsClass->GetName() == temporary ){543 if( Smoothie::Temp::pCompilingClass->pobj_InheritsClass->GetName() == temporary ){ 539 544 //基底クラスのコンストラクタを呼び出す 540 545 cp=i3; … … 553 558 Type dummyType; 554 559 CallProc( PROC_DEFAULT 555 , pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod()->pUserProc556 , pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod()->pUserProc->GetName().c_str()560 , Smoothie::Temp::pCompilingClass->pobj_InheritsClass->GetConstructorMethod()->pUserProc 561 , Smoothie::Temp::pCompilingClass->pobj_InheritsClass->GetConstructorMethod()->pUserProc->GetName().c_str() 557 562 , temporary 558 563 , dummyType ); … … 561 566 //基底クラスのコンストラクタを暗黙的に呼び出す 562 567 Opcode_CallProc("", 563 pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod()->pUserProc,568 Smoothie::Temp::pCompilingClass->pobj_InheritsClass->GetConstructorMethod()->pUserProc, 564 569 0, 565 570 "", … … 569 574 570 575 //仮想関数テーブルを初期化 571 if( pobj_CompilingClass->IsExistVirtualFunctions()572 && ! pobj_CompilingClass->IsAbstract() ){576 if( Smoothie::Temp::pCompilingClass->IsExistVirtualFunctions() 577 && !Smoothie::Temp::pCompilingClass->IsAbstract() ){ 573 578 //関数テーブルに値をセット 574 int offset = (int) pobj_CompilingClass->GetVtblGlobalOffset();579 int offset = (int)Smoothie::Temp::pCompilingClass->GetVtblGlobalOffset(); 575 580 576 581 //mov rax,offset … … 591 596 592 597 //デストラクタのコンパイル開始を通知 593 pobj_CompilingClass->NotifyStartDestructorCompile();598 Smoothie::Temp::pCompilingClass->NotifyStartDestructorCompile(); 594 599 } 595 600 } … … 617 622 ////////////////////////////////////////// 618 623 619 if( pobj_CompilingClass ){620 621 if( pobj_CompilingClass->IsCompilingConstructor() ){624 if( Smoothie::Temp::pCompilingClass ){ 625 626 if( Smoothie::Temp::pCompilingClass->IsCompilingConstructor() ){ 622 627 // コンストラクタをコンパイルしていたとき 623 628 624 629 // コンストラクタのコンパイルが完了したことを通知 625 pobj_CompilingClass->NotifyFinishConstructorCompile();630 Smoothie::Temp::pCompilingClass->NotifyFinishConstructorCompile(); 626 631 } 627 632 else if( pUserProc->IsDestructor() ){ … … 631 636 632 637 // デストラクタのコンパイルが完了したことを通知 633 pobj_CompilingClass->NotifyFinishDestructorCompile();634 635 if( pobj_CompilingClass->pobj_InheritsClass){638 Smoothie::Temp::pCompilingClass->NotifyFinishDestructorCompile(); 639 640 if(Smoothie::Temp::pCompilingClass->pobj_InheritsClass){ 636 641 /* サブクラスのデストラクタをコンパイルしているときは、 637 642 基底クラスのデストラクタを呼び出す */ 638 643 639 const CMethod *method = pobj_CompilingClass->pobj_InheritsClass->GetDestructorMethod();644 const CMethod *method = Smoothie::Temp::pCompilingClass->pobj_InheritsClass->GetDestructorMethod(); 640 645 if( method ){ 641 646 Opcode_CallProc("", … … 677 682 678 683 //ローカルオブジェクト(レキシカルスコープレベル=0)の解放処理 679 obj_LexScopes.CallDestructorsOfScopeEnd();684 GetLexicalScopes().CallDestructorsOfScopeEnd(); 680 685 681 686 //プロシージャ抜け出しスケジュール(Exit Sub/Function) … … 738 743 } 739 744 HeapDefaultFree(pLocalVarAddrSchedule); 740 foreach( Variable *pVar, pUserProc->localVars ){745 BOOST_FOREACH( Variable *pVar, pUserProc->localVars ){ 741 746 //後にデバッグで利用する 742 747 pVar->offset = AllLocalVarSize + pobj_sf->GetFrameSize() - pVar->offset; -
trunk/abdev/BasicCompiler64/Compile_Statement.cpp
r135 r183 1 #include <jenga/include/smoothie/LexicalAnalysis.h> 2 3 #include <LexicalScopingImpl.h> 4 #include <Compiler.h> 5 1 6 #include "../BasicCompiler_Common/common.h" 2 7 #include "Opcode.h" … … 131 136 if(resultType.IsDouble()){ 132 137 double dbl=0; 133 offset= dataTable.Add( dbl );138 offset=Compiler::GetNativeCode().GetDataTable().Add( dbl ); 134 139 135 140 //comisd xmm0,qword ptr[data table offset] … … 145 150 else if(resultType.IsSingle()){ 146 151 float flt=0; 147 offset= dataTable.Add( flt );152 offset=Compiler::GetNativeCode().GetDataTable().Add( flt ); 148 153 149 154 //comiss xmm0,dword ptr[data table offset] … … 195 200 196 201 //レキシカルスコープをレベルアップ 197 obj_LexScopes.Start( obp, SCOPE_TYPE_IF );202 GetLexicalScopes().Start( obp, SCOPE_TYPE_IF ); 198 203 199 204 i2=CompileBuffer(ESC_ENDIF,0); 200 205 201 206 //レキシカルスコープをレベルダウン 202 obj_LexScopes.End();207 GetLexicalScopes().End(); 203 208 204 209 … … 218 223 219 224 //レキシカルスコープをレベルアップ 220 obj_LexScopes.Start( obp, SCOPE_TYPE_IF );225 GetLexicalScopes().Start( obp, SCOPE_TYPE_IF ); 221 226 222 227 CompileBuffer(ESC_ENDIF,0); 223 228 224 229 //レキシカルスコープをレベルダウン 225 obj_LexScopes.End();230 GetLexicalScopes().End(); 226 231 227 232 … … 320 325 321 326 //レキシカルスコープをレベルアップ 322 obj_LexScopes.Start( obp, SCOPE_TYPE_WHILE );327 GetLexicalScopes().Start( obp, SCOPE_TYPE_WHILE ); 323 328 324 329 //While内をコンパイル 325 330 CompileBuffer(0,COM_WEND); 326 331 327 obj_LexScopes.CallDestructorsOfScopeEnd();332 GetLexicalScopes().CallDestructorsOfScopeEnd(); 328 333 329 334 //jmp ... … … 335 340 336 341 //レキシカルスコープをレベルダウン 337 obj_LexScopes.End();342 GetLexicalScopes().End(); 338 343 339 344 *((long *)(OpBuffer+je_schedule-sizeof(long)))=obp-je_schedule; //jeジャンプ先のオフセット値 … … 457 462 458 463 //レキシカルスコープをレベルアップ 459 obj_LexScopes.Start( obp, SCOPE_TYPE_FOR );464 GetLexicalScopes().Start( obp, SCOPE_TYPE_FOR ); 460 465 461 466 //For内をコンパイル 462 467 CompileBuffer(0,COM_NEXT); 463 468 464 obj_LexScopes.CallDestructorsOfScopeEnd();469 GetLexicalScopes().CallDestructorsOfScopeEnd(); 465 470 466 471 if(szNextVariable[0]){ … … 480 485 481 486 //レキシカルスコープをレベルダウン 482 obj_LexScopes.End();487 GetLexicalScopes().End(); 483 488 484 489 *((long *)(OpBuffer+je_schedule))=obp-(je_schedule+sizeof(long)); //jeジャンプ先のオフセット値 … … 504 509 505 510 //レキシカルスコープをレベルアップ 506 obj_LexScopes.Start( obp, SCOPE_TYPE_DO );511 GetLexicalScopes().Start( obp, SCOPE_TYPE_DO ); 507 512 508 513 //Do内をコンパイル 509 514 CompileBuffer(0,COM_LOOP); 510 515 511 obj_LexScopes.CallDestructorsOfScopeEnd();516 GetLexicalScopes().CallDestructorsOfScopeEnd(); 512 517 513 518 extern char *basbuf; … … 565 570 566 571 //レキシカルスコープをレベルダウン 567 obj_LexScopes.End();572 GetLexicalScopes().End(); 568 573 569 574 *((long *)(OpBuffer+je_schedule))=obp-(je_schedule+sizeof(long)); //jmpジャンプ先のオフセット値 … … 599 604 600 605 //未解放のローカルオブジェクトのデストラクタを呼び出す 601 obj_LexScopes.CallDestructorsOfReturn();606 GetLexicalScopes().CallDestructorsOfReturn(); 602 607 603 608 //jmp ...(End Sub/Function) … … 831 836 832 837 //レキシカルスコープをレベルアップ 833 obj_LexScopes.Start( obp, SCOPE_TYPE_SELECT );838 GetLexicalScopes().Start( obp, SCOPE_TYPE_SELECT ); 834 839 835 840 //Select Case内をコンパイル … … 848 853 849 854 //レキシカルスコープをレベルダウン 850 obj_LexScopes.End();855 GetLexicalScopes().End(); 851 856 852 857 pCaseSchedule=temp_pCaseSchedule; -
trunk/abdev/BasicCompiler64/Compile_Var.cpp
r159 r183 1 #include <jenga/include/smoothie/Smoothie.h> 2 #include <jenga/include/smoothie/LexicalAnalysis.h> 3 4 #include <LexicalScopingImpl.h> 5 #include <CodeGenerator.h> 6 #include <Compiler.h> 7 1 8 #include "../BasicCompiler_Common/common.h" 2 9 #include "Opcode.h" … … 216 223 217 224 //アクセシビリティをチェック 218 if(&objClass== pobj_CompilingClass){225 if(&objClass==Smoothie::Temp::pCompilingClass){ 219 226 //同一クラスオブジェクトの場合はプライベートアクセスを容認する 220 227 if(pMember->IsNoneAccess()){ … … 388 395 // 名前空間を分離 389 396 char namespaceStr[VN_SIZE]="", simpleName[VN_SIZE]; 390 Smoothie:: meta.namespaceScopesCollection.SplitNamespace( variable, namespaceStr, simpleName );397 Smoothie::GetMeta().namespaceScopesCollection.SplitNamespace( variable, namespaceStr, simpleName ); 391 398 392 399 // 先頭オブジェクトまたはクラス名と入れ子メンバに分割 … … 446 453 447 454 448 if( pobj_CompilingClass){455 if(Smoothie::Temp::pCompilingClass){ 449 456 ////////////////////// 450 457 // クラスメンバの参照 … … 457 464 pRelativeVar->dwKind=VAR_DIRECTMEM; 458 465 459 resultType.SetType( DEF_OBJECT, pobj_CompilingClass );466 resultType.SetType( DEF_OBJECT, Smoothie::Temp::pCompilingClass ); 460 467 return true; 461 468 } … … 470 477 471 478 bool isFound = false; 472 BOOST_FOREACH( CMember *pMember, pobj_CompilingClass->GetDynamicMembers() ){479 BOOST_FOREACH( CMember *pMember, Smoothie::Temp::pCompilingClass->GetDynamicMembers() ){ 473 480 if( pMember->GetName() == VarName ){ 474 481 isFound = true; … … 481 488 //Const修飾子のメソッド内でメンバ書き込みアクセスが発生したとき 482 489 //(コンストラクタ、デストラクタ内を除く) 483 const CMethod *pMethod = pobj_DBClass->GetNowCompilingMethodInfo();490 const CMethod *pMethod = Smoothie::GetMeta().GetClasses().GetNowCompilingMethodInfo(); 484 491 if( isWriteAccess && 485 492 pMethod->IsConst() && 486 pobj_CompilingClass->IsCompilingConstructor() == false &&487 pobj_CompilingClass->IsCompilingDestructor() == false493 Smoothie::Temp::pCompilingClass->IsCompilingConstructor() == false && 494 Smoothie::Temp::pCompilingClass->IsCompilingDestructor() == false 488 495 ){ 489 496 SetError(131, NULL, cp ); … … 497 504 isErrorEnabled, 498 505 isWriteAccess, 499 * pobj_CompilingClass,506 *Smoothie::Temp::pCompilingClass, 500 507 variable, 501 508 pRelativeVar, … … 541 548 } 542 549 543 int typeDefIndex = Smoothie:: meta.typeDefs.GetIndex( VarName );550 int typeDefIndex = Smoothie::GetMeta().typeDefs.GetIndex( VarName ); 544 551 if( typeDefIndex != -1 ){ 545 552 // TypeDef後の型名だったとき 546 lstrcpy( VarName, Smoothie:: meta.typeDefs[typeDefIndex].GetBaseName().c_str() );553 lstrcpy( VarName, Smoothie::GetMeta().typeDefs[typeDefIndex].GetBaseName().c_str() ); 547 554 } 548 555 … … 557 564 } 558 565 559 if( pobj_CompilingClass){566 if(Smoothie::Temp::pCompilingClass){ 560 567 //自身のクラスから静的メンバを参照する場合 561 568 char temp2[VN_SIZE]; 562 sprintf(temp2,"%s.%s", pobj_CompilingClass->GetName().c_str(),VarName);569 sprintf(temp2,"%s.%s",Smoothie::Temp::pCompilingClass->GetName().c_str(),VarName); 563 570 pVar = globalVars.Find( temp2 ); 564 571 if( pVar ){ … … 844 851 char *temp; 845 852 temp=(char *)i64data; 846 i2= dataTable.AddString( temp );853 i2=Compiler::GetNativeCode().GetDataTable().AddString( temp ); 847 854 HeapDefaultFree(temp); 848 855 … … 994 1001 char *temp; 995 1002 temp=(char *)i64data; 996 i2= dataTable.AddString( temp );1003 i2=Compiler::GetNativeCode().GetDataTable().AddString( temp ); 997 1004 HeapDefaultFree(temp); 998 1005 … … 1086 1093 1087 1094 //レキシカルスコープ 1088 pVar->ScopeLevel= obj_LexScopes.GetNowLevel();1089 pVar->ScopeStartAddress= obj_LexScopes.GetStartAddress();1095 pVar->ScopeLevel=GetLexicalScopes().GetNowLevel(); 1096 pVar->ScopeStartAddress=GetLexicalScopes().GetStartAddress(); 1090 1097 pVar->bLiving=TRUE; 1091 1098 … … 1121 1128 1122 1129 //レキシカルスコープ 1123 pVar->ScopeLevel= obj_LexScopes.GetNowLevel();1124 pVar->ScopeStartAddress= obj_LexScopes.GetStartAddress();1130 pVar->ScopeLevel=GetLexicalScopes().GetNowLevel(); 1131 pVar->ScopeStartAddress=GetLexicalScopes().GetStartAddress(); 1125 1132 pVar->bLiving=TRUE; 1126 1133 -
trunk/abdev/BasicCompiler64/MakePeHdr.cpp
r169 r183 1 1 #include <jenga/include/common/Environment.h> 2 3 #include <jenga/include/smoothie/Smoothie.h> 4 5 #include <LexicalScopingImpl.h> 6 #include <ClassImpl.h> 7 #include <Compiler.h> 2 8 3 9 #include "../BasicCompiler_Common/common.h" … … 119 125 ////////////////// 120 126 // データテーブル 121 dataTable.Init();127 Compiler::GetNativeCode().GetDataTable().Init(); 122 128 if(bDebugCompile){ 123 dataTable.Add( (long)0x00000002 );129 Compiler::GetNativeCode().GetDataTable().Add( (long)0x00000002 ); 124 130 } 125 131 … … 145 151 146 152 //関数ポインタ情報を初期化 147 Smoothie:: meta.procPointers.clear();153 Smoothie::GetMeta().GetProcPointers().clear(); 148 154 149 155 // 名前空間情報を取得 150 156 NamespaceScopesCollection::CollectNamespaces( 151 157 Smoothie::Lexical::source.GetBuffer(), 152 Smoothie:: meta.namespaceScopesCollection158 Smoothie::GetMeta().namespaceScopesCollection 153 159 ); 154 160 … … 156 162 // GetSubInfo関数の中で参照されるオブジェクト名を事前に取得する。 157 163 // ※オブジェクトの内容までは取得しない 158 pobj_DBClass=new Classes(); 159 pobj_DBClass->InitNames(); 164 Smoothie::GetMeta().GetClasses().CollectClassesForNameOnly( Smoothie::Lexical::source ); 160 165 161 166 //TypeDef情報を初期化 162 Smoothie:: meta.typeDefs.Init();167 Smoothie::GetMeta().typeDefs.Init(); 163 168 164 169 //定数情報を取得 … … 166 171 167 172 //サブルーチン(ユーザー定義、DLL関数)の識別子、アドレスを取得 168 pobj_CompilingClass=0;173 Smoothie::Temp::pCompilingClass = NULL; 169 174 GetSubInfo(); 170 175 171 176 //クラス情報を取得(※注 - GetSubInfoの後に呼び出す) 172 pobj_DBClass->GetAllClassInfo();177 Smoothie::GetMeta().GetClasses().GetAllClassInfo(); 173 178 174 179 //コードと行番号の関係 … … 280 285 281 286 obp_AllocSize=8192*2; 282 OpBuffer=(char *) HeapAlloc(hHeap,HEAP_ZERO_MEMORY,obp_AllocSize);287 OpBuffer=(char *)calloc(obp_AllocSize,1); 283 288 obp=0; 284 289 … … 287 292 288 293 //レキシカルスコープ情報を初期化 289 obj_LexScopes.Init(obp);294 GetLexicalScopes().Init(obp); 290 295 291 296 … … 311 316 if(!bDll){ 312 317 // 名前空間が初期化されているかをチェック 313 if( Smoothie:: Lexical::liveingNamespaceScopes.size() ){318 if( Smoothie::Temp::liveingNamespaceScopes.size() ){ 314 319 SetError(); 315 320 } … … 362 367 363 368 //クラスに属する静的メンバを定義 364 CMember::InitStaticMember();369 Smoothie::GetMeta().GetClasses().InitStaticMember(); 365 370 366 371 //グローバル実行領域をコンパイル開始 … … 426 431 427 432 // 名前空間が正しく閉じられているかをチェック 428 if( Smoothie:: Lexical::liveingNamespaceScopes.size() ){433 if( Smoothie::Temp::liveingNamespaceScopes.size() ){ 429 434 SetError(63,NULL,-1); 430 435 } … … 793 798 //(デバッグ情報で利用される) 794 799 extern int AllInitGlobalVarSize; 795 foreach( Variable *pVar, globalVars ){800 BOOST_FOREACH( Variable *pVar, globalVars ){ 796 801 if(pVar->offset&0x80000000){ 797 802 pVar->offset=(pVar->offset&0x7FFFFFFF)+AllInitGlobalVarSize; … … 876 881 877 882 //データセクションのファイル上のサイズ 878 if( dataTable.GetSize()%FILE_ALIGNMENT) FileSize_DataSection=dataTable.GetSize()+(FILE_ALIGNMENT-dataTable.GetSize()%FILE_ALIGNMENT);879 else FileSize_DataSection= dataTable.GetSize();883 if(Compiler::GetNativeCode().GetDataTable().GetSize()%FILE_ALIGNMENT) FileSize_DataSection=Compiler::GetNativeCode().GetDataTable().GetSize()+(FILE_ALIGNMENT-Compiler::GetNativeCode().GetDataTable().GetSize()%FILE_ALIGNMENT); 884 else FileSize_DataSection=Compiler::GetNativeCode().GetDataTable().GetSize(); 880 885 if(FileSize_DataSection) bUse_DataSection=1; 881 886 else bUse_DataSection=0; … … 1066 1071 //////////////////////////////////////// 1067 1072 //仮想関数データテーブルスケジュール 1068 pobj_DBClass->ActionVtblSchedule(ImageBase,MemPos_CodeSection);1073 Smoothie::GetMeta().GetClasses().ActionVtblSchedule(ImageBase,MemPos_CodeSection); 1069 1074 1070 1075 … … 1602 1607 if(bUse_DataSection){ 1603 1608 //データ テーブル 1604 WriteFile(hFile, dataTable.GetPtr(),dataTable.GetSize(),(DWORD *)&i2,NULL);1609 WriteFile(hFile,Compiler::GetNativeCode().GetDataTable().GetPtr(),Compiler::GetNativeCode().GetDataTable().GetSize(),(DWORD *)&i2,NULL); 1605 1610 i+=i2; 1606 1611 } … … 1698 1703 1699 1704 //コードバッファを解放 1700 HeapDefaultFree(OpBuffer);1705 free(OpBuffer); 1701 1706 OpBuffer=0; 1702 1707 … … 1714 1719 1715 1720 //クラスに関するメモリを解放 1716 delete pobj_DBClass; 1717 pobj_DBClass=0; 1721 Smoothie::GetMeta().GetClasses().Clear(); 1718 1722 } -
trunk/abdev/BasicCompiler64/NumOpe.cpp
r159 r183 1 #include <jenga/include/smoothie/Smoothie.h> 2 #include <jenga/include/smoothie/LexicalAnalysis.h> 3 4 #include <Compiler.h> 5 1 6 #include "../BasicCompiler_Common/common.h" 2 7 #include "Opcode.h" … … 18 23 SetStringQuotes( parameter ); 19 24 20 Operator_New( * pobj_DBClass->GetStringClassPtr(), "", parameter, Type( DEF_OBJECT, *pobj_DBClass->GetStringClassPtr() ) );25 Operator_New( *Smoothie::GetMeta().GetClasses().GetStringClassPtr(), "", parameter, Type( DEF_OBJECT, *Smoothie::GetMeta().GetClasses().GetStringClassPtr() ) ); 21 26 22 27 free( parameter ); … … 241 246 char member[VN_SIZE]; 242 247 CClass::RefType refType; 243 if( SplitMemberName( termFull, termLeft, member, refType ) ){248 if( CClass::SplitName( termFull, termLeft, member, refType ) ){ 244 249 /////////////////////////////////////////////////////////////////// 245 250 // オブジェクトとメンバに分解できるとき … … 253 258 Type leftType; 254 259 if( GetTermType( termLeft, leftType, isLiteral, &isClassName ) ){ 255 if( isClassName == false && Smoothie:: meta.blittableTypes.IsExist( leftType ) ){260 if( isClassName == false && Smoothie::GetMeta().blittableTypes.IsExist( leftType ) ){ 256 261 // 左側のオブジェクト部分がBlittable型のとき 257 262 … … 259 264 lstrcpy( temporary, termLeft ); 260 265 sprintf( termLeft, "%s(%s)", 261 Smoothie:: meta.blittableTypes.Find( leftType ).GetCreateStaticMethodFullName().c_str(),266 Smoothie::GetMeta().blittableTypes.Find( leftType ).GetCreateStaticMethodFullName().c_str(), 262 267 temporary ); 263 268 } … … 287 292 288 293 if( pIsClassName ){ 289 if( pobj_DBClass->Find( termFull ) ){294 if( Smoothie::GetMeta().GetClasses().Find( termFull ) ){ 290 295 *pIsClassName = true; 291 296 return true; … … 304 309 if(lstrcmpi(termFull,"This")==0 && isProcedureCallOnly == false ){ 305 310 //Thisオブジェクト 306 resultType.SetType( DEF_OBJECT, pobj_CompilingClass );311 resultType.SetType( DEF_OBJECT, Smoothie::Temp::pCompilingClass ); 307 312 308 313 SetThisPtrToReg( UseReg ); … … 588 593 } 589 594 590 i2 = dataTable.AddBinary( binary, num * tempBaseType.GetSize() );595 i2 = Compiler::GetNativeCode().GetDataTable().AddBinary( binary, num * tempBaseType.GetSize() ); 591 596 592 597 //mov reg,i2 … … 768 773 769 774 type_stack[sp]=DEF_OBJECT; 770 index_stack[sp]=(LONG_PTR) pobj_DBClass->GetStringClassPtr();775 index_stack[sp]=(LONG_PTR)Smoothie::GetMeta().GetClasses().GetStringClassPtr(); 771 776 bLiteralCalculation=0; 772 777 … … 781 786 bLiteralCalculation=0; 782 787 783 i2 = dataTable.AddString( term, i3 );788 i2 = Compiler::GetNativeCode().GetDataTable().AddString( term, i3 ); 784 789 785 790 //mov reg,i2 … … 877 882 } 878 883 else{ 879 index_stack[sp] = (LONG_PTR) pobj_DBClass->GetObjectClassPtr();884 index_stack[sp] = (LONG_PTR)Smoothie::GetMeta().GetClasses().GetObjectClassPtr(); 880 885 } 881 886 … … 966 971 } 967 972 else{ 968 i3 = dataTable.Add( i64data );973 i3 = Compiler::GetNativeCode().GetDataTable().Add( i64data ); 969 974 970 975 //movlpd xmm_reg,qword ptr[data table offset] … … 995 1000 } 996 1001 else{ 997 i3= dataTable.Add( i32data );1002 i3=Compiler::GetNativeCode().GetDataTable().Add( i32data ); 998 1003 999 1004 //movss xmm_reg,dword ptr[data table offset] … … 1134 1139 1135 1140 if(resultType.IsDouble()){ 1136 i3 = dataTable.Add( i64data );1141 i3 = Compiler::GetNativeCode().GetDataTable().Add( i64data ); 1137 1142 1138 1143 //movlpd xmm_reg,qword ptr[data table offset] … … 1154 1159 memcpy(&i32data,&flt,sizeof(long)); 1155 1160 1156 i3 = dataTable.Add( i32data );1161 i3 = Compiler::GetNativeCode().GetDataTable().Add( i32data ); 1157 1162 1158 1163 //movss xmm_reg,dword ptr[data table offset] -
trunk/abdev/BasicCompiler64/NumOpe_Arithmetic.cpp
r75 r183 1 #include <Compiler.h> 2 1 3 #include "../BasicCompiler_Common/common.h" 2 4 #include "Opcode.h" … … 452 454 double dbl; 453 455 dbl=-1; 454 i32data = dataTable.Add( dbl );456 i32data = Compiler::GetNativeCode().GetDataTable().Add( dbl ); 455 457 456 458 //mulsd xmm_reg,qword ptr[data table offset] ※data = -1 … … 474 476 float flt; 475 477 flt=-1; 476 i32data = dataTable.Add( flt );478 i32data = Compiler::GetNativeCode().GetDataTable().Add( flt ); 477 479 478 480 //mulss xmm_reg,dword ptr[data table offset] ※data = -1 -
trunk/abdev/BasicCompiler64/NumOpe_TypeOperation.cpp
r56 r183 1 #include <jenga/include/smoothie/Smoothie.h> 2 3 #include <Compiler.h> 4 1 5 #include "../BasicCompiler_Common/common.h" 2 6 #include "Opcode.h" … … 10 14 //and reg,00000000FFFFFFFFh 11 15 } 12 else if(type==DEF_INTEGER || ( isUnicode&&type==DEF_CHAR)){16 else if(type==DEF_INTEGER || (Smoothie::IsUnicode()&&type==DEF_CHAR)){ 13 17 //movsx reg64,reg16 14 18 op_movsx64_FromReg16(reg,reg); … … 18 22 op_and64_value(reg,(int)0xFFFF); 19 23 } 20 else if(type==DEF_SBYTE || ( isUnicode==false&&type==DEF_CHAR)){24 else if(type==DEF_SBYTE || (Smoothie::IsUnicode()==false&&type==DEF_CHAR)){ 21 25 //movsx reg64,reg8 22 26 op_movsx64_FromReg8(reg,reg); … … 28 32 } 29 33 void ExtendTypeTo32(int type,int reg){ 30 if(type==DEF_INTEGER || ( isUnicode&&type==DEF_CHAR)){34 if(type==DEF_INTEGER || (Smoothie::IsUnicode()&&type==DEF_CHAR)){ 31 35 //movsx reg32,reg16 32 36 op_movsx32_FromReg16(reg,reg); … … 36 40 op_and32_value(reg,(int)0xFFFF); 37 41 } 38 else if(type==DEF_SBYTE || ( isUnicode==false&&type==DEF_CHAR)){42 else if(type==DEF_SBYTE || (Smoothie::IsUnicode()==false&&type==DEF_CHAR)){ 39 43 //movsx reg32,reg8 40 44 op_movsx32_FromReg8(reg,reg); … … 46 50 } 47 51 void ExtendTypeTo16(int type,int reg){ 48 if(type==DEF_SBYTE || ( isUnicode==false&&type==DEF_CHAR)){52 if(type==DEF_SBYTE || (Smoothie::IsUnicode()==false&&type==DEF_CHAR)){ 49 53 //movsx reg16,reg8 50 54 op_movsx16_FromReg8(reg,reg); … … 85 89 int temp; 86 90 _int64 i64data=0x43f0000000000000; 87 temp= dataTable.Add( i64data );91 temp=Compiler::GetNativeCode().GetDataTable().Add( i64data ); 88 92 OpBuffer[obp++]=(char)0xF2; 89 93 OpBuffer[obp++]=(char)0x0F; … … 144 148 int temp; 145 149 long i32data=0x5f800000; 146 temp= dataTable.Add( i32data );150 temp=Compiler::GetNativeCode().GetDataTable().Add( i32data ); 147 151 OpBuffer[obp++]=(char)0xF3; 148 152 OpBuffer[obp++]=(char)0x0F;
Note:
See TracChangeset
for help on using the changeset viewer.