Changeset 206 in dev for trunk/abdev/BasicCompiler32
- Timestamp:
- Jul 12, 2007, 2:58:26 AM (17 years ago)
- Location:
- trunk/abdev/BasicCompiler32
- Files:
-
- 2 added
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler32/BasicCompiler.vcproj
r195 r206 53 53 BasicRuntimeChecks="3" 54 54 RuntimeLibrary="1" 55 UsePrecompiledHeader="2" 55 56 PrecompiledHeaderFile=".\Debug/BasicCompiler.pch" 56 57 AssemblerListingLocation=".\Debug/" 57 58 ObjectFile=".\Debug/" 58 59 ProgramDataBaseFileName=".\Debug/" 59 BrowseInformation=" 1"60 BrowseInformation="0" 60 61 WarningLevel="3" 61 62 SuppressStartupBanner="true" … … 155 156 EnableFunctionLevelLinking="true" 156 157 RuntimeTypeInfo="true" 158 UsePrecompiledHeader="2" 157 159 PrecompiledHeaderFile=".\Release/BasicCompiler.pch" 158 160 AssemblerListingLocation=".\Release/" … … 242 244 </FileConfiguration> 243 245 </File> 246 <File 247 RelativePath=".\stdafx.cpp" 248 > 249 <FileConfiguration 250 Name="Debug|Win32" 251 > 252 <Tool 253 Name="VCCLCompilerTool" 254 UsePrecompiledHeader="1" 255 /> 256 </FileConfiguration> 257 <FileConfiguration 258 Name="Release|Win32" 259 > 260 <Tool 261 Name="VCCLCompilerTool" 262 UsePrecompiledHeader="1" 263 /> 264 </FileConfiguration> 265 </File> 244 266 <Filter 245 267 Name="32及び64共通" … … 776 798 <File 777 799 RelativePath="..\BasicCompiler_Common\PESchedule.h" 778 >779 </File>780 </Filter>781 <Filter782 Name="Constant"783 >784 <File785 RelativePath="..\BasicCompiler_Common\Const.cpp"786 >787 <FileConfiguration788 Name="Debug|Win32"789 >790 <Tool791 Name="VCCLCompilerTool"792 PreprocessorDefinitions=""793 />794 </FileConfiguration>795 <FileConfiguration796 Name="Release|Win32"797 >798 <Tool799 Name="VCCLCompilerTool"800 PreprocessorDefinitions=""801 />802 </FileConfiguration>803 </File>804 <File805 RelativePath="..\BasicCompiler_Common\Const.h"806 800 > 807 801 </File> … … 1252 1246 > 1253 1247 <File 1254 RelativePath="..\BasicCompiler_Common\src\Class Impl.cpp"1248 RelativePath="..\BasicCompiler_Common\src\Class.cpp" 1255 1249 > 1256 1250 </File> … … 1264 1258 </File> 1265 1259 <File 1260 RelativePath="..\BasicCompiler_Common\src\Const.cpp" 1261 > 1262 </File> 1263 <File 1266 1264 RelativePath="..\BasicCompiler_Common\src\DataTable.cpp" 1267 1265 > … … 1276 1274 </File> 1277 1275 <File 1276 RelativePath="..\BasicCompiler_Common\src\Method.cpp" 1277 > 1278 </File> 1279 <File 1278 1280 RelativePath="..\BasicCompiler_Common\src\NamespaceSupporter.cpp" 1279 1281 > 1280 1282 </File> 1281 1283 <File 1282 RelativePath="..\BasicCompiler_Common\src\Procedure Impl.cpp"1284 RelativePath="..\BasicCompiler_Common\src\Procedure.cpp" 1283 1285 > 1284 1286 </File> … … 1292 1294 </File> 1293 1295 <File 1296 RelativePath="..\BasicCompiler_Common\src\Symbol.cpp" 1297 > 1298 </File> 1299 <File 1300 RelativePath="..\BasicCompiler_Common\src\Type.cpp" 1301 > 1302 </File> 1303 <File 1294 1304 RelativePath="..\BasicCompiler_Common\src\TypeDef.cpp" 1295 1305 > 1296 1306 </File> 1297 1307 <File 1298 RelativePath="..\BasicCompiler_Common\src\Variable Impl.cpp"1308 RelativePath="..\BasicCompiler_Common\src\Variable.cpp" 1299 1309 > 1300 1310 </File> … … 1310 1320 </File> 1311 1321 <File 1312 RelativePath="..\BasicCompiler_Common\BasicFixed.h"1313 >1314 </File>1315 <File1316 1322 RelativePath="CommandValue.h" 1317 1323 > … … 1327 1333 <File 1328 1334 RelativePath="..\BasicCompiler_Common\include\option.h" 1335 > 1336 </File> 1337 <File 1338 RelativePath=".\stdafx.h" 1329 1339 > 1330 1340 </File> … … 1353 1363 > 1354 1364 <File 1355 RelativePath="..\BasicCompiler_Common\include\Class Impl.h"1365 RelativePath="..\BasicCompiler_Common\include\Class.h" 1356 1366 > 1357 1367 </File> … … 1365 1375 </File> 1366 1376 <File 1377 RelativePath="..\BasicCompiler_Common\include\Const.h" 1378 > 1379 </File> 1380 <File 1367 1381 RelativePath="..\BasicCompiler_Common\include\DataTable.h" 1368 1382 > … … 1377 1391 </File> 1378 1392 <File 1393 RelativePath="..\BasicCompiler_Common\include\Member.h" 1394 > 1395 </File> 1396 <File 1379 1397 RelativePath="..\BasicCompiler_Common\include\MetaImpl.h" 1380 1398 > 1381 1399 </File> 1382 1400 <File 1401 RelativePath="..\BasicCompiler_Common\include\Method.h" 1402 > 1403 </File> 1404 <File 1383 1405 RelativePath="..\BasicCompiler_Common\include\NamespaceSupporter.h" 1384 1406 > 1385 1407 </File> 1386 1408 <File 1387 RelativePath="..\BasicCompiler_Common\include\ProcedureImpl.h" 1409 RelativePath="..\BasicCompiler_Common\include\Parameter.h" 1410 > 1411 </File> 1412 <File 1413 RelativePath="..\BasicCompiler_Common\include\Procedure.h" 1388 1414 > 1389 1415 </File> … … 1393 1419 </File> 1394 1420 <File 1421 RelativePath="..\BasicCompiler_Common\include\Prototype.h" 1422 > 1423 </File> 1424 <File 1395 1425 RelativePath="..\BasicCompiler_Common\include\SmoothieImpl.h" 1396 1426 > 1397 1427 </File> 1398 1428 <File 1429 RelativePath="..\BasicCompiler_Common\include\Symbol.h" 1430 > 1431 </File> 1432 <File 1433 RelativePath="..\BasicCompiler_Common\include\Type.h" 1434 > 1435 </File> 1436 <File 1399 1437 RelativePath="..\BasicCompiler_Common\include\TypeDef.h" 1400 1438 > 1401 1439 </File> 1402 1440 <File 1403 RelativePath="..\BasicCompiler_Common\include\Variable Impl.h"1441 RelativePath="..\BasicCompiler_Common\include\Variable.h" 1404 1442 > 1405 1443 </File> -
trunk/abdev/BasicCompiler32/CParameter.cpp
r76 r206 1 #include "stdafx.h" 2 1 3 #include "../BasicCompiler_Common/common.h" 2 4 #include "opcode.h" … … 108 110 109 111 //call free 110 extern UserProc *pSub_free;112 extern const UserProc *pSub_free; 111 113 op_call(pSub_free); 112 114 } … … 135 137 136 138 //call calloc 137 extern UserProc *pSub_calloc;139 extern const UserProc *pSub_calloc; 138 140 op_call(pSub_calloc); 139 141 -
trunk/abdev/BasicCompiler32/Compile_Calc.cpp
r193 r206 1 #include "stdafx.h" 2 1 3 #include <jenga/include/smoothie/Smoothie.h> 2 4 #include <jenga/include/smoothie/LexicalAnalysis.h> … … 481 483 } 482 484 else{ 483 if(GetConstHash(variable)){ 485 if( compiler.GetMeta().GetGlobalConsts().IsExist(variable) 486 || compiler.GetMeta().GetGlobalConstMacros().IsExist(variable) ) 487 { 484 488 //定数リストに該当したとき 485 489 SetError(1,NULL,cp); … … 626 630 if( varType.IsObject() && compiler.GetMeta().GetBlittableTypes().IsExist( calcType ) ){ 627 631 // Blittable型をオブジェクトとして扱う 628 vector< UserProc *> userProcs;632 vector<const UserProc *> userProcs; 629 633 compiler.GetMeta().GetBlittableTypes().GetClass( calcType ).GetStaticMethods().Enum( "_Create", userProcs ); 630 634 if( userProcs.size() != 1 ){ … … 632 636 return; 633 637 } 634 UserProc *pUserProc = userProcs[0];638 const UserProc *pUserProc = userProcs[0]; 635 639 636 640 // call System.[TypeClass]._Create -
trunk/abdev/BasicCompiler32/Compile_Calc_PushVar.cpp
r97 r206 1 #include "stdafx.h" 2 1 3 #include "../BasicCompiler_Common/common.h" 2 4 #include "Opcode.h" -
trunk/abdev/BasicCompiler32/Compile_CallProc.cpp
r193 r206 1 #include "stdafx.h" 2 1 3 #include <jenga/include/smoothie/Smoothie.h> 2 4 … … 12 14 void Call_DebugSys_SaveContext(){ 13 15 //call _System_GetEip 14 extern UserProc *pSub_System_GetEip;16 extern const UserProc *pSub_System_GetEip; 15 17 op_call(pSub_System_GetEip); 16 18 … … 22 24 23 25 //call _DebugSys_SaveContext 24 extern UserProc *pSub_DebugSys_SaveContext;26 extern const UserProc *pSub_DebugSys_SaveContext; 25 27 op_call(pSub_DebugSys_SaveContext); 26 28 } … … 95 97 } 96 98 97 bool Opcode_CallProc(const char *Parameter, UserProc *pUserProc,DWORD dwFlags,const char *ObjectName,int RefType){99 bool Opcode_CallProc(const char *Parameter,const UserProc *pUserProc,DWORD dwFlags,const char *ObjectName,int RefType){ 98 100 int i2; 99 101 … … 123 125 if(lstrcmpi(ObjectName,"Super")==0){ 124 126 //クラスメンバ関数内から基底クラスの呼び出し 125 pobj_c= Smoothie::Temp::pCompilingClass;127 pobj_c=compiler.pCompilingClass; 126 128 } 127 129 else{ … … 148 150 else{ 149 151 //クラスメンバ関数内から同一クラスのメンバ関数の呼び出し 150 pobj_c= Smoothie::Temp::pCompilingClass;152 pobj_c=compiler.pCompilingClass; 151 153 } 152 154 } … … 177 179 if(ObjectName[0]){ 178 180 //外部からの呼び出し 179 if(pobj_c== Smoothie::Temp::pCompilingClass){181 if(pobj_c==compiler.pCompilingClass){ 180 182 //同一クラスオブジェクトの場合はプライベートアクセスを容認する 181 183 if( pMethod->IsNoneAccess() ){ … … 261 263 262 264 //call calloc 263 extern UserProc *pSub_calloc;265 extern const UserProc *pSub_calloc; 264 266 op_call(pSub_calloc); 265 267 -
trunk/abdev/BasicCompiler32/Compile_Func.cpp
r193 r206 1 #include "stdafx.h" 2 1 3 #include <jenga/include/smoothie/Smoothie.h> 2 4 … … 196 198 } 197 199 198 int SubScripts[MAX_ARRAYDIM];200 Subscripts subscripts; 199 201 RELATIVE_VAR RelativeVar; 200 if(!GetVarOffsetReadOnly(tempParm,&RelativeVar,type, SubScripts)) return;202 if(!GetVarOffsetReadOnly(tempParm,&RelativeVar,type,&subscripts)) return; 201 203 202 204 if(type.GetBasicType()&FLAG_PTR){ … … 209 211 int typeSize = type.GetSize(); 210 212 211 if(bArrayHead) typeSize*=JumpSubScripts( SubScripts);213 if(bArrayHead) typeSize*=JumpSubScripts(subscripts); 212 214 213 215 //mov eax,TypeSize … … 218 220 void Opcode_Func_AddressOf( const char *name ){ 219 221 extern int cp; 220 UserProc *pUserProc;222 const UserProc *pUserProc; 221 223 222 224 extern LONG_PTR ProcPtr_BaseIndex; … … 224 226 //左辺の型にのっとり、オーバーロードを解決 225 227 226 std::vector< UserProc *> subs;228 std::vector<const UserProc *> subs; 227 229 GetOverloadSubHash( name, subs ); 228 230 if( subs.size() == 0 ){ … … 284 286 SetThisPtrToReg(REG_RCX); 285 287 286 pobj_c= Smoothie::Temp::pCompilingClass;288 pobj_c=compiler.pCompilingClass; 287 289 } 288 290 -
trunk/abdev/BasicCompiler32/Compile_Object.cpp
r140 r206 1 #include "stdafx.h" 2 1 3 #include "../BasicCompiler_Common/common.h" 2 4 #include "opcode.h" … … 35 37 //////////////////////// 36 38 37 std::vector< UserProc *> subs;39 std::vector<const UserProc *> subs; 38 40 pobj_c->GetMethods().Enum( pobj_c->GetName().c_str(), subs ); 39 41 40 UserProc *pUserProc;42 const UserProc *pUserProc; 41 43 if( subs.size() > 0 ){ 42 44 //オーバーロードを解決 … … 161 163 162 164 //call _System_GC_malloc_ForObject 163 extern UserProc *pSub_System_GC_malloc_ForObject;165 extern const UserProc *pSub_System_GC_malloc_ForObject; 164 166 op_call(pSub_System_GC_malloc_ForObject); 165 167 } … … 169 171 170 172 //call _System_GC_malloc_ForObjectPtr 171 extern UserProc *pSub_System_GC_malloc_ForObjectPtr;173 extern const UserProc *pSub_System_GC_malloc_ForObjectPtr; 172 174 op_call(pSub_System_GC_malloc_ForObjectPtr); 173 175 } … … 213 215 //mov ecx,DestructorProcAddr 214 216 OpBuffer[obp++]=(char)0xB9; 215 pobj_SubAddrSchedule->add( method->pUserProc,0);216 method-> pUserProc->Using();217 pobj_SubAddrSchedule->add(&method->GetUserProc(),0); 218 method->GetUserProc().Using(); 217 219 obp+=sizeof(long); 218 220 … … 351 353 if( isSweeping ){ 352 354 //call _System_GC_free_for_SweepingDelete 353 extern UserProc *pSub_System_GC_free_for_SweepingDelete;355 extern const UserProc *pSub_System_GC_free_for_SweepingDelete; 354 356 op_call(pSub_System_GC_free_for_SweepingDelete); 355 357 } 356 358 else{ 357 359 //call free 358 extern UserProc *pSub_free;360 extern const UserProc *pSub_free; 359 361 op_call(pSub_free); 360 362 } -
trunk/abdev/BasicCompiler32/Compile_ProcOp.cpp
r204 r206 1 #include "stdafx.h" 2 1 3 #include <jenga/include/smoothie/Smoothie.h> 2 4 #include <jenga/include/smoothie/LexicalAnalysis.h> … … 5 7 #include <Compiler.h> 6 8 #include <LexicalScopingImpl.h> 7 #include <Class Impl.h>8 #include <Variable Impl.h>9 #include <Class.h> 10 #include <Variable.h> 9 11 #include <NamespaceSupporter.h> 10 12 … … 36 38 } 37 39 38 UserProc *pBackUserProc;40 const UserProc *pBackUserProc; 39 41 pBackUserProc = &UserProc::CompilingUserProc(); 40 42 UserProc::CompileStartForGlobalArea(); … … 54 56 55 57 //_System_StartupProgramの呼び出し 56 extern UserProc *pSub_System_StartupProgram;58 extern const UserProc *pSub_System_StartupProgram; 57 59 op_call(pSub_System_StartupProgram); 58 60 … … 71 73 //静的ローカルオブジェクトのコンストラクタ呼び出し 72 74 73 BOOST_FOREACH( Variable *pVar, globalVars){75 BOOST_FOREACH( Variable *pVar, compiler.GetMeta().GetGlobalVars() ){ 74 76 if(memicmp(pVar->GetName().c_str(),"Static%",7)==0){ 75 77 //コンストラクタ呼び出し 76 if( pVar-> IsObject() ){78 if( pVar->GetType().IsObject() ){ 77 79 78 80 //エラー用 … … 81 83 CallConstructor( 82 84 pVar->GetName().c_str(), 83 pVar->GetSub ScriptsPtr(),84 *pVar,85 pVar-> paramStrForConstructor.c_str());85 pVar->GetSubscripts(), 86 pVar->GetType(), 87 pVar->GetParamStrForConstructor().c_str()); 86 88 } 87 89 } … … 93 95 else if( userProc.GetName() == "_System_Call_Destructor_of_GlobalObject" ){ 94 96 95 UserProc *pBackUserProc;97 const UserProc *pBackUserProc; 96 98 pBackUserProc = &UserProc::CompilingUserProc(); 97 99 UserProc::CompileStartForGlobalArea(); … … 222 224 } 223 225 } 224 void AutoGeneration( UserProc &userProc){226 void AutoGeneration( const UserProc &userProc){ 225 227 if( userProc.GetName() == "InitializeUserTypes" 226 228 && userProc.HasParentClass() … … 240 242 } 241 243 242 void _compile_proc( UserProc *pUserProc){244 void _compile_proc(const UserProc *pUserProc){ 243 245 extern char *basbuf; 244 246 extern HANDLE hHeap; 245 extern GlobalProc **ppSubHash;246 247 extern BOOL bDebugCompile; 247 248 int i3,i4,LocalVarSchedule,EspOffsetSchedule,BaseOffset; … … 250 251 if( pUserProc->IsUsing() == false || pUserProc->IsCompiled() ) return; 251 252 252 if( pUserProc-> localVars.size() ){253 if( pUserProc->GetLocalVars().size() ){ 253 254 SetError(); 254 255 return; 255 256 } 257 258 trace_for_sourcecodestep( "★★★ " << pUserProc->GetFullName() << "のコンパイルを開始" ); 256 259 257 260 pUserProc->CompleteCompile(); … … 270 273 else bDebugSupportProc=0; 271 274 272 pUserProc-> beginOpAddress=obp;275 pUserProc->SetBeginOpAddress( obp ); 273 276 274 277 //コンパイル中の関数が属するクラス 275 Smoothie::Temp::pCompilingClass=pUserProc->GetParentClassPtr();278 compiler.pCompilingClass=pUserProc->GetParentClassPtr(); 276 279 277 280 //コンパイルスタートをクラス管理クラスに追加 … … 297 300 SystemProc(*pUserProc); 298 301 299 pUserProc-> endOpAddress=obp;302 pUserProc->SetEndOpAddress( obp ); 300 303 return; 301 304 } … … 321 324 Parameter ¶m = *pUserProc->RealParams()[i3]; 322 325 323 Variable *pVar = new Variable Impl( param.GetVarName(), param, false, param.IsRef());326 Variable *pVar = new Variable( param.GetVarName(), param, false, param.IsRef(), "" ); 324 327 325 328 if( param.IsArray() ){ 326 pVar->SetArray( param.GetSub ScriptsPtr() );329 pVar->SetArray( param.GetSubscripts() ); 327 330 } 328 331 … … 342 345 } 343 346 AllLocalVarSize+=varSize; 344 pVar-> offset=AllLocalVarSize;347 pVar->SetOffsetAddress( AllLocalVarSize ); 345 348 346 349 //レキシカルスコープ情報 347 pVar->S copeLevel=GetLexicalScopes().GetNowLevel();348 pVar->S copeStartAddress=GetLexicalScopes().GetStartAddress();350 pVar->SetScopeLevel( GetLexicalScopes().GetNowLevel() ); 351 pVar->SetScopeStartAddress( GetLexicalScopes().GetStartAddress() ); 349 352 pVar->bLiving=TRUE; 350 353 351 pUserProc-> localVars.push_back( pVar );354 pUserProc->GetLocalVars().push_back( pVar ); 352 355 } 353 356 … … 456 459 457 460 //call _DebugSys_StartProc 458 extern UserProc *pSub_DebugSys_StartProc;461 extern const UserProc *pSub_DebugSys_StartProc; 459 462 op_call(pSub_DebugSys_StartProc); 460 463 } 461 464 462 if( Smoothie::Temp::pCompilingClass){463 if( pUserProc->GetName() == Smoothie::Temp::pCompilingClass->GetName() ){465 if(compiler.pCompilingClass){ 466 if( pUserProc->GetName() == compiler.pCompilingClass->GetName() ){ 464 467 //////////////////////////////////// 465 468 // コンストラクタをコンパイルするとき … … 467 470 468 471 //コンストラクタのコンパイル開始を通知 469 Smoothie::Temp::pCompilingClass->NotifyStartConstructorCompile();472 compiler.pCompilingClass->NotifyStartConstructorCompile(); 470 473 471 474 //基底クラスかどうかの識別 472 475 //(継承元がインターフェイスの場合も基底クラスと見なす) 473 476 BOOL bThisIsSuperClass; 474 if( ! Smoothie::Temp::pCompilingClass->HasSuperClass() ) bThisIsSuperClass=1;475 else if( Smoothie::Temp::pCompilingClass->GetSuperClass().GetConstructorMethod() == NULL ){477 if( !compiler.pCompilingClass->HasSuperClass() ) bThisIsSuperClass=1; 478 else if( compiler.pCompilingClass->GetSuperClass().GetConstructorMethod() == NULL ){ 476 479 //インターフェイスを継承したときはコンストラクタを持たない 477 480 bThisIsSuperClass=1; … … 492 495 temporary[i4]=basbuf[i3]; 493 496 } 494 if( Smoothie::Temp::pCompilingClass->GetSuperClass().GetName() == temporary ){497 if( compiler.pCompilingClass->GetSuperClass().GetName() == temporary ){ 495 498 //基底クラスのコンストラクタを呼び出す 496 499 cp=i3; … … 509 512 Type dummyType; 510 513 CallProc( PROC_DEFAULT 511 , Smoothie::Temp::pCompilingClass->GetSuperClass().GetConstructorMethod()->pUserProc512 , Smoothie::Temp::pCompilingClass->GetSuperClass().GetConstructorMethod()->pUserProc->GetName().c_str()514 , &compiler.pCompilingClass->GetSuperClass().GetConstructorMethod()->GetUserProc() 515 , compiler.pCompilingClass->GetSuperClass().GetConstructorMethod()->GetUserProc().GetName().c_str() 513 516 , temporary 514 517 , dummyType ); … … 517 520 //基底クラスのコンストラクタを暗黙的に呼び出す 518 521 Opcode_CallProc("", 519 Smoothie::Temp::pCompilingClass->GetSuperClass().GetConstructorMethod()->pUserProc,522 &compiler.pCompilingClass->GetSuperClass().GetConstructorMethod()->GetUserProc(), 520 523 0, 521 524 "", … … 525 528 526 529 //仮想関数テーブルを初期化 527 if( Smoothie::Temp::pCompilingClass->IsExistVirtualFunctions()528 && ! Smoothie::Temp::pCompilingClass->IsAbstract() ){530 if( compiler.pCompilingClass->IsExistVirtualFunctions() 531 && !compiler.pCompilingClass->IsAbstract() ){ 529 532 //関数テーブルに値をセット 530 int offset = (int) Smoothie::Temp::pCompilingClass->GetVtblGlobalOffset();533 int offset = (int)compiler.pCompilingClass->GetVtblGlobalOffset(); 531 534 532 535 //mov eax,offset … … 548 551 549 552 //デストラクタのコンパイル開始を通知 550 Smoothie::Temp::pCompilingClass->NotifyStartDestructorCompile();553 compiler.pCompilingClass->NotifyStartDestructorCompile(); 551 554 } 552 555 } … … 574 577 ////////////////////////////////////////// 575 578 576 if( Smoothie::Temp::pCompilingClass ){577 578 if( Smoothie::Temp::pCompilingClass->IsCompilingConstructor() ){579 if( compiler.pCompilingClass ){ 580 581 if( compiler.pCompilingClass->IsCompilingConstructor() ){ 579 582 // コンストラクタをコンパイルしていたとき 580 583 581 584 // コンストラクタのコンパイルが完了したことを通知 582 Smoothie::Temp::pCompilingClass->NotifyFinishConstructorCompile();585 compiler.pCompilingClass->NotifyFinishConstructorCompile(); 583 586 } 584 587 else if( pUserProc->IsDestructor() ){ … … 588 591 589 592 // デストラクタのコンパイルが完了したことを通知 590 Smoothie::Temp::pCompilingClass->NotifyFinishDestructorCompile();591 592 if( Smoothie::Temp::pCompilingClass->HasSuperClass() ){593 compiler.pCompilingClass->NotifyFinishDestructorCompile(); 594 595 if( compiler.pCompilingClass->HasSuperClass() ){ 593 596 /* サブクラスのデストラクタをコンパイルしているときは、 594 597 基底クラスのデストラクタを呼び出す */ 595 598 596 const CMethod *method = Smoothie::Temp::pCompilingClass->GetSuperClass().GetDestructorMethod();599 const CMethod *method = compiler.pCompilingClass->GetSuperClass().GetDestructorMethod(); 597 600 if( method ){ 598 601 Opcode_CallProc("", 599 method->pUserProc,602 &method->GetUserProc(), 600 603 0, 601 604 "", … … 649 652 650 653 //call _DebugSys_EndProc 651 extern UserProc *pSub_DebugSys_EndProc;654 extern const UserProc *pSub_DebugSys_EndProc; 652 655 op_call(pSub_DebugSys_EndProc); 653 656 } … … 742 745 } 743 746 HeapDefaultFree(pLocalVarAddrSchedule); 744 BOOST_FOREACH( Variable *pVar, pUserProc-> localVars){747 BOOST_FOREACH( Variable *pVar, pUserProc->GetLocalVars() ){ 745 748 //後にデバッグで利用する 746 pVar-> offset = AllLocalVarSize - pVar->offset;749 pVar->SetOffsetAddress( AllLocalVarSize - pVar->GetOffsetAddress() ); 747 750 } 748 751 … … 771 774 772 775 //call _esp_error 773 extern UserProc *pSub_esp_error;776 extern const UserProc *pSub_esp_error; 774 777 op_call( pSub_esp_error ); 775 778 … … 799 802 800 803 801 pUserProc-> endOpAddress=obp;804 pUserProc->SetEndOpAddress( obp ); 802 805 803 806 … … 811 814 } 812 815 813 void CompileBufferInProcedure( UserProc &userProc ){816 void CompileBufferInProcedure( const UserProc &userProc ){ 814 817 if( userProc.IsUsing() == false || userProc.IsCompiled() ) return; 815 818 … … 827 830 } 828 831 void CompileLocal(){ 829 extern GlobalProc **ppSubHash;830 int i2;831 832 832 extern BOOL bDll; 833 833 if(bDll){ 834 834 //DLLの場合はグローバル変数を初期化するための関数を一番初めにコンパイルする 835 UserProc *pUserProc=GetSubHash("_System_InitDllGlobalVariables");835 const UserProc *pUserProc=GetSubHash("_System_InitDllGlobalVariables"); 836 836 if(pUserProc){ 837 837 CompileBufferInProcedure( *pUserProc ); … … 841 841 842 842 //_System_TypeBase_InitializeUserTypesは一番最後にコンパイル 843 extern UserProc *pSubStaticMethod_System_TypeBase_InitializeUserTypes;843 extern const UserProc *pSubStaticMethod_System_TypeBase_InitializeUserTypes; 844 844 pSubStaticMethod_System_TypeBase_InitializeUserTypes->CompleteCompile(); 845 845 846 846 //_System_InitStaticLocalVariablesは一番最後にコンパイル 847 847 //※一般関数内の静的変数オブジェクトをすべて収集しなければならない 848 extern UserProc *pSub_System_InitStaticLocalVariables;848 extern const UserProc *pSub_System_InitStaticLocalVariables; 849 849 pSub_System_InitStaticLocalVariables->CompleteCompile(); 850 850 851 851 //_System_Call_Destructor_of_GlobalObjectは一番最後にコンパイル 852 extern UserProc *pSub_System_Call_Destructor_of_GlobalObject;852 extern const UserProc *pSub_System_Call_Destructor_of_GlobalObject; 853 853 pSub_System_Call_Destructor_of_GlobalObject->CompleteCompile(); 854 854 855 855 repeat: 856 GlobalProc *pGlobalProc; 857 for(i2=0;i2<MAX_HASH;i2++){ 858 pGlobalProc=ppSubHash[i2]; 859 while(pGlobalProc){ 860 CompileBufferInProcedure( *pGlobalProc ); 861 pGlobalProc=pGlobalProc->pNextData; 862 } 856 compiler.GetMeta().GetUserProcs().Iterator_Reset(); 857 while( compiler.GetMeta().GetUserProcs().Iterator_HasNext() ) 858 { 859 UserProc *pUserProc = compiler.GetMeta().GetUserProcs().Iterator_GetNext(); 860 CompileBufferInProcedure( *pUserProc ); 863 861 } 864 862 … … 874 872 if( IsNeedProcCompile() ){ 875 873 //プロシージャコンパイルによって、プロシージャコンパイルが必要になる場合 876 for(i2=0;i2<MAX_HASH;i2++){ 877 pGlobalProc=ppSubHash[i2];878 while(pGlobalProc){879 CompileBufferInProcedure( *pGlobalProc );880 pGlobalProc=pGlobalProc->pNextData;881 }874 875 compiler.GetMeta().GetUserProcs().Iterator_Reset(); 876 while( compiler.GetMeta().GetUserProcs().Iterator_HasNext() ) 877 { 878 UserProc *pUserProc = compiler.GetMeta().GetUserProcs().Iterator_GetNext(); 879 CompileBufferInProcedure( *pUserProc ); 882 880 } 883 881 } -
trunk/abdev/BasicCompiler32/Compile_Set_Var.cpp
r183 r206 1 #include "stdafx.h" 2 1 3 #include <jenga/include/smoothie/Smoothie.h> 2 4 … … 40 42 41 43 //call free 42 extern UserProc *pSub_free;44 extern const UserProc *pSub_free; 43 45 op_call(pSub_free); 44 46 } -
trunk/abdev/BasicCompiler32/Compile_Statement.cpp
r183 r206 1 #include "stdafx.h" 2 1 3 #include <jenga/include/smoothie/LexicalAnalysis.h> 2 4 … … 9 11 void OpcodeOthers( const char *Command ){ 10 12 int i,i2; 11 UserProc *pUserProc;12 13 13 14 char leftTerm[8192]; … … 59 60 ////////////////////////////// 60 61 61 pUserProc=GetSubHash(Command);62 const UserProc *pUserProc = GetSubHash(Command); 62 63 63 64 //GetSubHash内でエラー提示が行われた場合 … … 1079 1080 1080 1081 if(type1.IsObject()){ 1081 std::vector< UserProc *> subs;1082 std::vector<const UserProc *> subs; 1082 1083 type1.GetClass().GetMethods().Enum( CALC_EQUAL, subs ); 1083 1084 if( subs.size() == 0 ){ … … 1089 1090 1090 1091 //オーバーロードを解決 1091 UserProc *pUserProc; 1092 pUserProc=OverloadSolution("==",subs, params, NULL); 1092 const UserProc *pUserProc = OverloadSolution("==",subs, params, NULL); 1093 1093 1094 1094 delete params[0]; … … 1326 1326 //戻り値をセット 1327 1327 if(Parameter[0]){ 1328 UserProc &proc = UserProc::CompilingUserProc();1328 const UserProc &proc = UserProc::CompilingUserProc(); 1329 1329 1330 1330 const char *temp = "_System_ReturnValue"; -
trunk/abdev/BasicCompiler32/Compile_Var.cpp
r193 r206 1 #include "stdafx.h" 2 1 3 #include <jenga/include/smoothie/Smoothie.h> 2 4 #include <jenga/include/smoothie/LexicalAnalysis.h> … … 5 7 #include <CodeGenerator.h> 6 8 #include <Compiler.h> 7 #include <Variable Impl.h>9 #include <Variable.h> 8 10 9 11 #include "../BasicCompiler_Common/common.h" … … 11 13 12 14 //変数 13 Variables globalVars; 15 // TODO: xml未完成 14 16 int AllGlobalVarSize; 15 17 int AllInitGlobalVarSize; … … 64 66 } 65 67 } 66 bool GetArrayOffset(const int *SubScripts,char *array, const Type &type){68 bool GetArrayOffset(const Subscripts &subscripts,char *array, const Type &type){ 67 69 extern HANDLE hHeap; 68 70 int i,i2,i3,i4; … … 83 85 } 84 86 if(array[i]==','||array[i]=='\0'){ 85 if(SubScripts[i3]==-1){ 87 if( i3 >= (int)subscripts.size() ) 88 { 86 89 for(i3--;i3>=0;i3--) HeapDefaultFree(pParm[i3]); 87 90 return 0; … … 96 99 97 100 if(array[i]=='\0'){ 98 if(SubScripts[i3]!=-1){ 101 if( i3 < (int)subscripts.size() ) 102 { 99 103 for(i3--;i3>=0;i3--) HeapDefaultFree(pParm[i3]); 100 104 return 0; … … 131 135 op_pop(REG_EAX); 132 136 133 for(i2=i+1,i4=1;i2<i3;i2++) i4*= SubScripts[i2]+1;137 for(i2=i+1,i4=1;i2<i3;i2++) i4*=subscripts[i2]+1; 134 138 135 139 //imul eax,i4 … … 175 179 char lpPtrOffset[VN_SIZE]; //第2次配列 176 180 char NestMember[VN_SIZE]; //入れ子メンバ 177 CClass::RefTyperefType;181 ReferenceKind refType; 178 182 lstrcpy(VarName,member); 179 183 if(!GetVarFormatString(VarName,array,lpPtrOffset,NestMember,refType)) return false; … … 195 199 196 200 //アクセシビリティをチェック 197 if(&objClass== Smoothie::Temp::pCompilingClass){201 if(&objClass==compiler.pCompilingClass){ 198 202 //同一クラスオブジェクトの場合はプライベートアクセスを容認する 199 203 if(pMember->IsNoneAccess()){ … … 228 232 //ポインタ変数の場合 229 233 if( resultType.IsPointer() ){ 230 if( pMember->SubScripts[0]==-1){234 if( pMember->GetSubscripts().size() == 0 ){ 231 235 lstrcpy(lpPtrOffset,array); 232 236 array[0]=0; … … 250 254 if(array[0]){ 251 255 //配列オフセット 252 if(!GetArrayOffset(pMember-> SubScripts,array,pMember->GetType())){256 if(!GetArrayOffset(pMember->GetSubscripts(),array,pMember->GetType())){ 253 257 if(isErrorEnabled) SetError(14,member,cp); 254 258 } 255 259 } 256 else if( pMember->SubScripts[0]!=-1){260 else if( pMember->GetSubscripts().size() > 0 ){ 257 261 resultType.SetBasicType( resultType.GetBasicType() | FLAG_PTR ); 258 262 } … … 262 266 263 267 if( resultType.IsObject() || resultType.IsStruct() ){ 264 if( refType != CClass::Dot ){268 if( refType != RefDot ){ 265 269 if(isErrorEnabled) SetError(104,member,cp); 266 270 return false; … … 278 282 //pObj[n].member 279 283 if( ( resultType.IsObjectPtr() || resultType.IsStructPtr() ) 280 && refType != CClass::Dot ){284 && refType != RefDot ){ 281 285 if(isErrorEnabled) SetError(104,member,cp); 282 286 return false; … … 292 296 //pObj->member 293 297 if( ( resultType.IsObjectPtr() || resultType.IsStructPtr() ) 294 && refType != CClass::Pointer ){298 && refType != RefPointer ){ 295 299 if(isErrorEnabled) SetError(104,member,cp); 296 300 return false; … … 306 310 if(lpPtrOffset[0]){ 307 311 //ppObj[n]->member 308 if( refType != CClass::Pointer ){312 if( refType != RefPointer ){ 309 313 if(isErrorEnabled) SetError(104,member,cp); 310 314 return false; … … 357 361 } 358 362 359 bool GetVarOffset(bool isErrorEnabled,bool isWriteAccess,const char *NameBuffer,RELATIVE_VAR *pRelativeVar,Type &resultType, int *pss){363 bool GetVarOffset(bool isErrorEnabled,bool isWriteAccess,const char *NameBuffer,RELATIVE_VAR *pRelativeVar,Type &resultType, Subscripts *pResultSubscripts ){ 360 364 char variable[VN_SIZE]; 361 365 … … 371 375 372 376 // 先頭オブジェクトまたはクラス名と入れ子メンバに分割 373 CClass::RefTyperefType;377 ReferenceKind refType; 374 378 char member[VN_SIZE],array[VN_SIZE],lpPtrOffset[VN_SIZE]; 375 379 GetVarFormatString(simpleName,array,lpPtrOffset,member,refType); … … 384 388 } 385 389 386 const int *pSubScripts;390 const Subscripts *pSubscripts; 387 391 bool bConst = false; 388 392 … … 393 397 ////////////////// 394 398 395 const Variable *pVar = UserProc::CompilingUserProc(). localVars.BackSearch( Symbol( VarName ) );399 const Variable *pVar = UserProc::CompilingUserProc().GetLocalVars().BackSearch( Symbol( VarName ) ); 396 400 if( pVar ){ 397 401 //ポインタ変数の場合 398 if( pVar-> IsPointer() ){402 if( pVar->GetType().IsPointer() ){ 399 403 if( !pVar->IsArray() ){ 400 404 lstrcpy(lpPtrOffset,array); … … 410 414 } 411 415 412 pRelativeVar->offset=-pVar-> offset;416 pRelativeVar->offset=-pVar->GetOffsetAddress(); 413 417 pRelativeVar->bOffsetOffset=0; 414 418 if( pVar->IsRef() ){ … … 417 421 } 418 422 else pRelativeVar->dwKind=VAR_LOCAL; 419 resultType = *pVar;420 pSub Scripts=pVar->GetSubScriptsPtr();423 resultType = pVar->GetType(); 424 pSubscripts = &pVar->GetSubscripts(); 421 425 bConst = pVar->IsConst(); 422 426 … … 425 429 } 426 430 427 if( Smoothie::Temp::pCompilingClass){431 if(compiler.pCompilingClass){ 428 432 ////////////////////// 429 433 // クラスメンバの参照 … … 438 442 pRelativeVar->dwKind=VAR_DIRECTMEM; 439 443 440 resultType.SetType( DEF_OBJECT, Smoothie::Temp::pCompilingClass );444 resultType.SetType( DEF_OBJECT, compiler.pCompilingClass ); 441 445 return true; 442 446 } … … 451 455 452 456 bool isFound = false; 453 BOOST_FOREACH( CMember *pMember, Smoothie::Temp::pCompilingClass->GetDynamicMembers() ){457 BOOST_FOREACH( CMember *pMember, compiler.pCompilingClass->GetDynamicMembers() ){ 454 458 if( pMember->GetName() == VarName ){ 455 459 isFound = true; … … 465 469 if( isWriteAccess && 466 470 pMethod->IsConst() && 467 Smoothie::Temp::pCompilingClass->IsCompilingConstructor() == false &&468 Smoothie::Temp::pCompilingClass->IsCompilingDestructor() == false471 compiler.pCompilingClass->IsCompilingConstructor() == false && 472 compiler.pCompilingClass->IsCompilingDestructor() == false 469 473 ){ 470 474 SetError(131, NULL, cp ); … … 481 485 isErrorEnabled, 482 486 isWriteAccess, 483 * Smoothie::Temp::pCompilingClass,487 *compiler.pCompilingClass, 484 488 variable, 485 489 pRelativeVar, … … 502 506 GetNowStaticVarFullName(VarName,temporary); 503 507 504 pVar = globalVars.Find( Symbol( temporary ) );508 pVar = compiler.GetMeta().GetGlobalVars().Find( Symbol( temporary ) ); 505 509 if( pVar ){ 506 510 goto GlobalOk; … … 521 525 char tempArray[VN_SIZE]; 522 526 { 523 CClass::RefTyperefType;527 ReferenceKind refType; 524 528 GetVarFormatString(temporary,tempArray,lpPtrOffset,tempMember, refType ); 525 529 } … … 533 537 char temp2[VN_SIZE]; 534 538 sprintf(temp2,"%s.%s",VarName,temporary); 535 pVar = globalVars.Find( Symbol( temp2 ) );539 pVar = compiler.GetMeta().GetGlobalVars().Find( Symbol( temp2 ) ); 536 540 if( pVar ){ 537 541 lstrcpy(member,tempMember); … … 541 545 } 542 546 543 if( Smoothie::Temp::pCompilingClass){547 if(compiler.pCompilingClass){ 544 548 //自身のクラスから静的メンバを参照する場合 545 549 char temp2[VN_SIZE]; 546 sprintf(temp2,"%s.%s", Smoothie::Temp::pCompilingClass->GetName().c_str(),VarName);547 pVar = globalVars.Find( Symbol( temp2 ) );550 sprintf(temp2,"%s.%s",compiler.pCompilingClass->GetName().c_str(),VarName); 551 pVar = compiler.GetMeta().GetGlobalVars().Find( Symbol( temp2 ) ); 548 552 if( pVar ){ 549 553 goto GlobalOk; … … 555 559 ///////////////////// 556 560 557 pVar = globalVars.BackSearch( Symbol( VarName ) );561 pVar = compiler.GetMeta().GetGlobalVars().BackSearch( Symbol( VarName ) ); 558 562 if( pVar ){ 559 563 goto GlobalOk; … … 568 572 GlobalOk: 569 573 //ポインタ変数の場合 570 if( pVar-> IsPointer() ){574 if( pVar->GetType().IsPointer() ){ 571 575 if( !pVar->IsArray() ){ 572 576 lstrcpy(lpPtrOffset,array); … … 582 586 } 583 587 584 pRelativeVar->offset=pVar-> offset;588 pRelativeVar->offset=pVar->GetOffsetAddress(); 585 589 pRelativeVar->bOffsetOffset=0; 586 590 if( pVar->IsRef() ){ … … 589 593 } 590 594 else pRelativeVar->dwKind=VAR_GLOBAL; 591 resultType = *pVar;592 pSub Scripts=pVar->GetSubScriptsPtr();595 resultType = pVar->GetType(); 596 pSubscripts=&pVar->GetSubscripts(); 593 597 bConst = pVar->IsConst(); 594 598 } … … 610 614 } 611 615 612 if( array[0]==0&&pSubScripts[0]!=-1){616 if( array[0] == 0 && pSubscripts->size() > 0 ){ 613 617 //配列の先頭ポインタを示す場合 614 618 resultType.SetBasicType( resultType.GetBasicType() | FLAG_PTR ); 615 if(pss) memcpy(pss,pSubScripts,MAX_ARRAYDIM); 619 620 if( pResultSubscripts ) 621 { 622 (*pResultSubscripts) = *pSubscripts; 623 } 616 624 return true; 617 625 } … … 625 633 } 626 634 if(array[0]){ 627 if(!GetArrayOffset( pSubScripts,array,resultType)){635 if(!GetArrayOffset(*pSubscripts,array,resultType)){ 628 636 SetError(14,variable,cp); 629 637 pRelativeVar->dwKind=NON_VAR; … … 634 642 if( resultType.IsObject() || resultType.IsStruct() ){ 635 643 //実態オブジェクトのメンバを参照(obj.member) 636 if( refType != CClass::Dot ){644 if( refType != RefDot ){ 637 645 SetError(104,VarName,cp); 638 646 pRelativeVar->dwKind=NON_VAR; … … 649 657 if(lpPtrOffset[0]){ 650 658 //pObj[n].member 651 if( refType != CClass::Dot ){659 if( refType != RefDot ){ 652 660 SetError(104,VarName,cp); 653 661 pRelativeVar->dwKind=NON_VAR; … … 659 667 else{ 660 668 //pObj->member 661 if( refType != CClass::Pointer ){669 if( refType != RefPointer ){ 662 670 SetError(104,VarName,cp); 663 671 pRelativeVar->dwKind=NON_VAR; … … 677 685 if(lpPtrOffset[0]){ 678 686 //ppObj[n]->member 679 if( refType != CClass::Pointer ){687 if( refType != RefPointer ){ 680 688 SetError(104,VarName,cp); 681 689 pRelativeVar->dwKind=NON_VAR; … … 722 730 } 723 731 724 bool SetInitGlobalData(int offset,const Type &type,const int *SubScripts,const char *lpszInitBuf){732 bool SetInitGlobalData(int offset,const Type &type,const Subscripts &subscripts,const char *lpszInitBuf){ 725 733 extern BYTE *initGlobalBuf; 726 734 int i2,i3; … … 735 743 int typeSize = type.GetSize(); 736 744 737 if(SubScripts[0]!=-1){ 738 typeSize*=JumpSubScripts(SubScripts+1); 739 int i=0; 740 i2=0; 741 while(1){ 742 if(SubScripts[0]<i2){ 743 SetError(41,0,cp); 744 return 0; 745 } 746 i=GetOneParameter(InitBuf,i,temporary); 747 if(!SetInitGlobalData( 748 offset+i2*typeSize, 749 type, 750 SubScripts+1, 751 temporary)) return false; 752 i2++; 753 if(InitBuf[i]=='\0') break; 745 if( subscripts.size() > 0 ){ 746 Subscripts nestSubscripts; 747 for( int i=1; i<(int)subscripts.size(); i++ ) 748 { 749 nestSubscripts.push_back( subscripts[i] ); 750 } 751 752 typeSize*=JumpSubScripts( nestSubscripts ); 753 { 754 int i=0; 755 i2=0; 756 while(1){ 757 if( subscripts[0] < i2 ){ 758 SetError(41,0,cp); 759 return 0; 760 } 761 i=GetOneParameter(InitBuf,i,temporary); 762 if(!SetInitGlobalData( 763 offset+i2*typeSize, 764 type, 765 nestSubscripts, 766 temporary)) return false; 767 i2++; 768 if(InitBuf[i]=='\0') break; 769 } 754 770 } 755 771 return true; … … 772 788 if(!SetInitGlobalData(offset+i3, 773 789 pMember->GetType(), 774 pMember-> SubScripts,790 pMember->GetSubscripts(), 775 791 temporary)) return false; 776 792 } … … 793 809 } 794 810 795 if( SubScripts[0]!=-1){811 if( subscripts.size() > 0 ){ 796 812 SetError(41,0,cp); 797 813 return false; … … 861 877 return true; 862 878 } 863 bool InitLocalVar(int offset,const Type &type,const int *SubScripts,const char *lpszInitBuf){864 int i ,i2,i3;879 bool InitLocalVar(int offset,const Type &type,const Subscripts &subscripts,const char *lpszInitBuf){ 880 int i2,i3; 865 881 char temporary[VN_SIZE]; 866 882 char InitBuf[VN_SIZE]; … … 873 889 int typeSize = type.GetSize(); 874 890 875 if(SubScripts[0]!=-1){ 876 typeSize*=JumpSubScripts(SubScripts+1); 877 i=0; 878 i2=0; 879 while(1){ 880 if(SubScripts[0]<i2){ 881 SetError(41,0,cp); 882 return false; 883 } 884 i=GetOneParameter(InitBuf,i,temporary); 885 if(!InitLocalVar( 886 offset+i2*typeSize, 887 type, 888 SubScripts+1, 889 temporary)) return false; 890 i2++; 891 if(InitBuf[i]=='\0') break; 891 if( subscripts.size() > 0 ){ 892 Subscripts nestSubscripts; 893 for( int i=1; i<(int)subscripts.size(); i++ ) 894 { 895 nestSubscripts.push_back( subscripts[i] ); 896 } 897 898 typeSize*=JumpSubScripts( nestSubscripts ); 899 { 900 int i=0; 901 i2=0; 902 while(1){ 903 if( subscripts[0] < i2 ){ 904 SetError(41,0,cp); 905 return 0; 906 } 907 i=GetOneParameter(InitBuf,i,temporary); 908 if(!InitLocalVar( 909 offset+i2*typeSize, 910 type, 911 nestSubscripts, 912 temporary)) return false; 913 i2++; 914 if(InitBuf[i]=='\0') break; 915 } 892 916 } 893 917 return true; … … 910 934 if(!InitLocalVar(offset+i3, 911 935 pMember->GetType(), 912 pMember-> SubScripts,936 pMember->GetSubscripts(), 913 937 temporary)) return false; 914 938 … … 927 951 /////////////////////////////////////// 928 952 929 if( SubScripts[0]!=-1){953 if( subscripts.size() > 0 ){ 930 954 SetError(41,0,cp); 931 955 return false; … … 1075 1099 } 1076 1100 1077 void dim( char *VarName, int *SubScripts,Type &type,const char *InitBuf,const char *ConstractParameter,DWORD dwFlags){1101 void dim( char *VarName, const Subscripts &subscripts, Type &type,const char *InitBuf,const char *ConstractParameter,DWORD dwFlags){ 1078 1102 if( UserProc::IsGlobalAreaCompiling() ){ 1079 1103 ///////////////////////// … … 1081 1105 ///////////////////////// 1082 1106 1083 AddGlobalVariable(VarName, SubScripts,type,InitBuf,ConstractParameter,dwFlags);1107 AddGlobalVariable(VarName,subscripts,type,InitBuf,ConstractParameter,dwFlags); 1084 1108 } 1085 1109 else{ … … 1088 1112 ///////////////// 1089 1113 1090 if( UserProc::CompilingUserProc(). localVars.DuplicateCheck( Symbol( VarName ) ) ){1114 if( UserProc::CompilingUserProc().GetLocalVars().DuplicateCheck( Symbol( VarName ) ) ){ 1091 1115 //2重定義のエラー 1092 1116 SetError(15,VarName,cp); … … 1096 1120 bool isConst = ( dwFlags & DIMFLAG_CONST ) ? true:false; 1097 1121 1098 Variable *pVar = new Variable Impl( VarName, type, isConst);1099 1100 if( SubScripts[0] != -1){1122 Variable *pVar = new Variable( VarName, type, isConst, false, ConstractParameter ); 1123 1124 if( subscripts.size() > 0 ){ 1101 1125 //配列あり 1102 pVar->SetArray( SubScripts ); 1103 } 1104 1105 //コンストラクタ用パラメータ 1106 pVar->paramStrForConstructor = ConstractParameter; 1126 pVar->SetArray( subscripts ); 1127 } 1107 1128 1108 1129 //レキシカルスコープ 1109 pVar->S copeLevel=GetLexicalScopes().GetNowLevel();1110 pVar->S copeStartAddress=GetLexicalScopes().GetStartAddress();1130 pVar->SetScopeLevel( GetLexicalScopes().GetNowLevel() ); 1131 pVar->SetScopeStartAddress( GetLexicalScopes().GetStartAddress() ); 1111 1132 pVar->bLiving=TRUE; 1112 1133 … … 1115 1136 1116 1137 // 変数を追加 1117 UserProc::CompilingUserProc(). localVars.push_back( pVar );1138 UserProc::CompilingUserProc().GetLocalVars().push_back( pVar ); 1118 1139 1119 1140 //アラインメントを考慮 1120 if( pVar-> IsStruct() ){1121 int alignment = pVar->Get Class().iAlign;1141 if( pVar->GetType().IsStruct() ){ 1142 int alignment = pVar->GetType().GetClass().iAlign; 1122 1143 1123 1144 if( alignment ){ … … 1139 1160 1140 1161 AllLocalVarSize += pVar->GetMemorySize(); 1141 pVar-> offset = AllLocalVarSize;1162 pVar->SetOffsetAddress( AllLocalVarSize ); 1142 1163 1143 1164 //レキシカルスコープ 1144 pVar->S copeLevel=GetLexicalScopes().GetNowLevel();1145 pVar->S copeStartAddress=GetLexicalScopes().GetStartAddress();1165 pVar->SetScopeLevel( GetLexicalScopes().GetNowLevel() ); 1166 pVar->SetScopeStartAddress( GetLexicalScopes().GetStartAddress() ); 1146 1167 pVar->bLiving=TRUE; 1147 1168 … … 1153 1174 1154 1175 int result = 0; 1155 if( !pVar-> IsObject() ){1156 result = InitLocalVar(-pVar-> offset,1157 *pVar,1158 pVar->GetSub ScriptsPtr(),1176 if( !pVar->GetType().IsObject() ){ 1177 result = InitLocalVar(-pVar->GetOffsetAddress(), 1178 pVar->GetType(), 1179 pVar->GetSubscripts(), 1159 1180 InitBuf); 1160 1181 } … … 1184 1205 //add eax,offset 1185 1206 OpBuffer[obp++]=(char)0x05; 1186 *((long *)(OpBuffer+obp))=-pVar-> offset;1207 *((long *)(OpBuffer+obp))=-pVar->GetOffsetAddress(); 1187 1208 AddLocalVarAddrSchedule(); 1188 1209 obp+=sizeof(long); … … 1204 1225 if( type.IsObject() &&(dwFlags&DIMFLAG_NONCALL_CONSTRACTOR)==0&&InitBuf[0]=='\0'){ 1205 1226 char objectSize[255]; 1206 if( SubScripts[0] == -1){1227 if( subscripts.size() == 0 ){ 1207 1228 objectSize[0] = 0; 1208 1229 } 1209 1230 else{ 1210 if( SubScripts[1] != -1 ){1231 if( subscripts.size() > 1 ){ 1211 1232 SetError(300,NULL,cp); 1212 1233 } 1213 sprintf( objectSize, "%d", SubScripts[0] );1234 sprintf( objectSize, "%d", subscripts[0] ); 1214 1235 } 1215 1236 Operator_New( type.GetClass(), objectSize, ConstractParameter, type ); … … 1323 1344 1324 1345 bool Compile_AddGlobalRootsForGc(){ 1325 UserProc *pUserProc_AddGlobalRootPtr = GetClassMethod( "_System_CGarbageCollection", "AddGlobalRootPtr" );1346 const UserProc *pUserProc_AddGlobalRootPtr = GetClassMethod( "_System_CGarbageCollection", "AddGlobalRootPtr" ); 1326 1347 if( !pUserProc_AddGlobalRootPtr ){ 1327 1348 SetError(3, "_System_CGarbageCollection.AddGlobalRootPtr", -1 ); … … 1329 1350 } 1330 1351 1331 BOOST_FOREACH( const Variable *pVar, globalVars){1332 if( pVar-> IsObject() || pVar->IsPointer() || pVar->IsStruct() ){1352 BOOST_FOREACH( const Variable *pVar, compiler.GetMeta().GetGlobalVars() ){ 1353 if( pVar->GetType().IsObject() || pVar->GetType().IsPointer() || pVar->GetType().IsStruct() ){ 1333 1354 // オブジェクトまたはポインタだったとき 1334 1355 // ※構造体も含む(暫定対応) … … 1342 1363 1343 1364 //mov eax,offset 1344 op_mov_RV(REG_EAX,(int)pVar-> offset);1365 op_mov_RV(REG_EAX,(int)pVar->GetOffsetAddress()); 1345 1366 obp-=sizeof(long); 1346 1367 pobj_GlobalVarSchedule->add(); -
trunk/abdev/BasicCompiler32/MakePeHdr.cpp
r201 r206 1 #include "stdafx.h" 2 1 3 #include <jenga/include/common/Environment.h> 2 4 … … 4 6 5 7 #include <LexicalScopingImpl.h> 6 #include <Class Impl.h>8 #include <Class.h> 7 9 #include <Compiler.h> 8 10 #include <NamespaceSupporter.h> 9 11 12 #include <../Enum.h> 13 10 14 #include "../BasicCompiler_Common/common.h" 15 #include "../BasicCompiler_Common/DebugSection.h" 11 16 #include "Opcode.h" 12 17 … … 19 24 20 25 // グローバル関数、静的メソッド 21 UserProc26 const UserProc 22 27 *pSub_System_StartupProgram, 23 28 *pSub_DebugSys_StartProc, … … 51 56 52 57 // 動的メソッド 53 UserProc58 const UserProc 54 59 *pUserProc_System_CGarbageCollection_RegisterGlobalRoots; 55 60 … … 176 181 177 182 //クラス名を取得(詳細情報はGetAllClassInfoで取得) 178 // GetSubInfo関数の中で参照されるオブジェクト名を事前に取得する。183 // CollectUserProcs関数の中で参照されるオブジェクト名を事前に取得する。 179 184 // ※オブジェクトの内容までは取得しない 180 185 compiler.GetMeta().GetClasses().CollectClassesForNameOnly( Smoothie::Lexical::source ); … … 186 191 GetConstInfo(); 187 192 188 // サブルーチン(ユーザー定義、DLL関数)の識別子、アドレスを取得189 Smoothie::Temp::pCompilingClass=0;190 GetSubInfo();191 192 // クラス情報を取得(※注 - GetSubInfoの後に呼び出す)193 // サブルーチン(ユーザー定義、DLL関数)の識別子、アドレスを取得 194 compiler.pCompilingClass=0; 195 UserProcs::CollectUserProcs( Smoothie::Lexical::source, compiler.GetMeta().GetUserProcs() ); 196 197 // クラス情報を取得(※注 - CollectUserProcsの後に呼び出す) 193 198 compiler.GetMeta().GetClasses().GetAllClassInfo(); 199 200 // サブルーチン(ユーザー定義、DLL関数)のイテレータの準備 201 compiler.GetMeta().GetUserProcs().Iterator_Init(); 194 202 195 203 if( !compiler.GetMeta().Write( Jenga::Common::Environment::GetAppDir() + "\\meta_test.xml" ) ) … … 197 205 MessageBox(0,"XML書き込みに失敗","test",0); 198 206 } 199 MetaImpl tempMeta;200 if( ! tempMeta.Read( Jenga::Common::Environment::GetAppDir() + "\\meta_test.xml" ) )207 MetaImpl *pTempMeta = new MetaImpl(); 208 if( !pTempMeta->Read( Jenga::Common::Environment::GetAppDir() + "\\meta_test.xml" ) ) 201 209 { 202 210 MessageBox(0,"XML読み込みに失敗","test",0); 203 211 } 212 compiler.GetMeta() = (*pTempMeta); 204 213 205 214 //コードと行番号の関係 … … 401 410 extern DWORD dwContinueAddress; 402 411 dwContinueAddress=-1; 412 413 trace_for_sourcecodestep( "★★★ グローバル領域のコンパイルを開始" ); 403 414 404 415 … … 451 462 452 463 //call _System_End 453 extern UserProc *pSub_System_End;464 extern const UserProc *pSub_System_End; 454 465 op_call(pSub_System_End); 455 466 … … 593 604 ExportNamesLength=lstrlen(lpExportNames)+1; 594 605 595 extern GlobalProc **ppSubHash; 596 GlobalProc *pUserProc,*psi2; 606 UserProc *pUserProc,*psi2; 597 607 while(1){ 598 608 //辞書順にサーチ 599 609 temporary[0]=0; 600 for(i=0,psi2=0;i<MAX_HASH;i++){ 601 pUserProc=ppSubHash[i]; 602 while(pUserProc){ 603 if(pUserProc->IsExport()){ 604 if(temporary[0]=='\0'){ 610 compiler.GetMeta().GetUserProcs().Iterator_Reset(); 611 while( compiler.GetMeta().GetUserProcs().Iterator_HasNext() ) 612 { 613 pUserProc = compiler.GetMeta().GetUserProcs().Iterator_GetNext(); 614 if(pUserProc->IsExport()){ 615 if(temporary[0]=='\0'){ 616 lstrcpy(temporary,pUserProc->GetName().c_str()); 617 psi2=pUserProc; 618 } 619 else{ 620 i3=lstrlen(temporary); 621 i4=(int)pUserProc->GetName().size(); 622 if(i3<i4) i3=i4; 623 if(memcmp(temporary,pUserProc->GetName().c_str(),i3)>0){ 605 624 lstrcpy(temporary,pUserProc->GetName().c_str()); 606 625 psi2=pUserProc; 607 626 } 608 else{609 i3=lstrlen(temporary);610 i4=(int)pUserProc->GetName().size();611 if(i3<i4) i3=i4;612 if(memcmp(temporary,pUserProc->GetName().c_str(),i3)>0){613 lstrcpy(temporary,pUserProc->GetName().c_str());614 psi2=pUserProc;615 }616 }617 627 } 618 pUserProc=pUserProc->pNextData;619 628 } 620 629 } … … 625 634 626 635 if( pUserProc->GetName() == "DllMain" ){ 627 DllMain_EntryPoint=pUserProc-> beginOpAddress;636 DllMain_EntryPoint=pUserProc->GetBeginOpAddress(); 628 637 } 629 638 630 639 lpdwExportAddressTable=(DWORD *)HeapReAlloc(hHeap,0,lpdwExportAddressTable,(ExportNum+1)*sizeof(DWORD)); 631 lpdwExportAddressTable[ExportNum]=pUserProc-> beginOpAddress;640 lpdwExportAddressTable[ExportNum]=pUserProc->GetBeginOpAddress(); 632 641 633 642 lpdwExportNamePointerTable=(DWORD *)HeapReAlloc(hHeap,0,lpdwExportNamePointerTable,(ExportNum+1)*sizeof(DWORD)); … … 808 817 //(デバッグ情報で利用される) 809 818 extern int AllInitGlobalVarSize; 810 BOOST_FOREACH( Variable *pVar, globalVars){811 if(pVar-> offset&0x80000000){812 pVar-> offset=(pVar->offset&0x7FFFFFFF)+AllInitGlobalVarSize;819 BOOST_FOREACH( Variable *pVar, compiler.GetMeta().GetGlobalVars() ){ 820 if(pVar->GetOffsetAddress()&0x80000000){ 821 pVar->SetOffsetAddress( (pVar->GetOffsetAddress()&0x7FFFFFFF)+AllInitGlobalVarSize ); 813 822 } 814 823 } … … 1110 1119 // プロシージャポインタスケジュール 1111 1120 for(i=0;i<pobj_SubAddrSchedule->num;i++){ 1112 if(pobj_SubAddrSchedule->ppsi[i]-> beginOpAddress==01113 &&pobj_SubAddrSchedule->ppsi[i]-> endOpAddress==0){1121 if(pobj_SubAddrSchedule->ppsi[i]->GetBeginOpAddress()==0 1122 &&pobj_SubAddrSchedule->ppsi[i]->GetEndOpAddress()==0){ 1114 1123 SetError(300,NULL,-1); 1115 1124 } … … 1117 1126 if(pobj_SubAddrSchedule->pbCall[i]){ 1118 1127 *((long *)(OpBuffer+pobj_SubAddrSchedule->pObpValues[i]))= 1119 pobj_SubAddrSchedule->ppsi[i]-> beginOpAddress-(pobj_SubAddrSchedule->pObpValues[i]+sizeof(long));1128 pobj_SubAddrSchedule->ppsi[i]->GetBeginOpAddress()-(pobj_SubAddrSchedule->pObpValues[i]+sizeof(long)); 1120 1129 } 1121 1130 else{ 1122 1131 *((long *)(OpBuffer+pobj_SubAddrSchedule->pObpValues[i]))= 1123 pobj_SubAddrSchedule->ppsi[i]-> beginOpAddress+ImageBase+MemPos_CodeSection;1132 pobj_SubAddrSchedule->ppsi[i]->GetBeginOpAddress()+ImageBase+MemPos_CodeSection; 1124 1133 } 1125 1134 } -
trunk/abdev/BasicCompiler32/NumOpe.cpp
r193 r206 1 #include "stdafx.h" 2 1 3 #include <jenga/include/smoothie/Smoothie.h> 2 4 #include <jenga/include/smoothie/LexicalAnalysis.h> … … 179 181 // 動的メソッドを検索 180 182 /////////////////////////////////////////////////////////////////// 181 vector< UserProc *> userProcs;183 vector<const UserProc *> userProcs; 182 184 183 185 char methodName[VN_SIZE], lpPtrOffset[VN_SIZE], parameter[VN_SIZE], dummy[1]; 184 CClass::RefTyperefType;186 ReferenceKind refType; 185 187 lstrcpy( methodName, member ); 186 188 GetVarFormatString(methodName,parameter,lpPtrOffset,dummy,refType); 187 189 188 190 objClass.GetMethods().Enum( methodName, userProcs ); 189 UserProc *pUserProc;190 191 if(userProcs.size()){ 191 192 //オーバーロードを解決 192 pUserProc=OverloadSolutionWithStrParam(termFull,userProcs,parameter,termLeft);193 const UserProc *pUserProc = OverloadSolutionWithStrParam(termFull,userProcs,parameter,termLeft); 193 194 194 195 if( pUserProc ){ … … 248 249 // パース 249 250 char member[VN_SIZE]; 250 CClass::RefTyperefType;251 if( CClass::SplitName( termFull, termLeft, member, refType ) ){251 ReferenceKind refType; 252 if( SplitMemberName( termFull, termLeft, member, refType ) ){ 252 253 /////////////////////////////////////////////////////////////////// 253 254 // オブジェクトとメンバに分解できるとき … … 312 313 if(lstrcmpi(termFull,"This")==0 && isProcedureCallOnly == false ){ 313 314 //Thisオブジェクト 314 resultType.SetType( DEF_OBJECT, Smoothie::Temp::pCompilingClass );315 resultType.SetType( DEF_OBJECT, compiler.pCompilingClass ); 315 316 316 317 SetThisPtrToReg( useReg ); … … 386 387 return true; 387 388 } 388 else if(GetConstCalcBuffer(procName,parameter,temporary)){ 389 ///////////////////////// 390 // マクロ関数 391 ///////////////////////// 392 393 //閉じカッコ")"に続く文字がNULLでないときはエラーにする 394 if(termFull[i2+1+i4+1]!='\0') SetError(42,NULL,cp); 395 396 //マクロ関数の場合 397 NumOpe(useReg, temporary,Type(),resultType); 398 399 if(!IS_LITERAL(resultType.GetIndex())){ 400 //リテラル値ではなかったとき 401 isLiteral = false; 389 ConstMacro *pConstMacro = compiler.GetMeta().GetGlobalConstMacros().Find( procName ); 390 if( pConstMacro ) 391 { 392 if( pConstMacro->GetCalcBuffer( parameter, temporary ) ) 393 { 394 ///////////////////////// 395 // マクロ関数 396 ///////////////////////// 397 398 //閉じカッコ")"に続く文字がNULLでないときはエラーにする 399 if(termFull[i2+1+i4+1]!='\0') SetError(42,NULL,cp); 400 401 //マクロ関数の場合 402 NumOpe(useReg, temporary,Type(),resultType); 403 404 if(!IS_LITERAL(resultType.GetIndex())){ 405 //リテラル値ではなかったとき 406 isLiteral = false; 407 } 408 409 return true; 402 410 } 403 404 return true;405 411 } 406 412 } … … 855 861 ////////////// 856 862 857 i3 = CDBConst::obj.GetBasicType(term);863 i3 = compiler.GetMeta().GetGlobalConsts().GetBasicType(term); 858 864 if(i3){ 859 if( CDBConst::obj.IsStringPtr( term ) ){865 if( compiler.GetMeta().GetGlobalConsts().IsStringPtr( term ) ){ 860 866 //リテラル文字列 861 867 862 double dbl = CDBConst::obj.GetDoubleData(term);868 double dbl = compiler.GetMeta().GetGlobalConsts().GetDoubleData(term); 863 869 memcpy(&i64data,&dbl,sizeof(double)); 864 870 … … 874 880 if(IsRealNumberType(i3)){ 875 881 //実数 876 double dbl = CDBConst::obj.GetDoubleData(term);882 double dbl = compiler.GetMeta().GetGlobalConsts().GetDoubleData(term); 877 883 memcpy(&i64data,&dbl,sizeof(double)); 878 884 goto Literal; … … 880 886 else if(IsWholeNumberType(i3)){ 881 887 //整数 882 i64data = CDBConst::obj.GetWholeData(term);888 i64data = compiler.GetMeta().GetGlobalConsts().GetWholeData(term); 883 889 goto Literal; 884 890 } -
trunk/abdev/BasicCompiler32/NumOpe_Arithmetic.cpp
r75 r206 1 #include "stdafx.h" 2 1 3 #include "../BasicCompiler_Common/common.h" 2 4 #include "Opcode.h" … … 270 272 271 273 //call _allmul 272 extern UserProc *pSub_allmul;274 extern const UserProc *pSub_allmul; 273 275 op_call(pSub_allmul); 274 276 … … 460 462 461 463 //call _aullrem 462 extern UserProc *pSub_aullrem;464 extern const UserProc *pSub_aullrem; 463 465 op_call(pSub_aullrem); 464 466 } … … 467 469 468 470 //call _allrem 469 extern UserProc *pSub_allrem;471 extern const UserProc *pSub_allrem; 470 472 op_call(pSub_allrem); 471 473 } … … 720 722 721 723 //call _aulldiv 722 extern UserProc *pSub_aulldiv;724 extern const UserProc *pSub_aulldiv; 723 725 op_call(pSub_aulldiv); 724 726 } … … 727 729 728 730 //call _alldiv 729 extern UserProc *pSub_alldiv;731 extern const UserProc *pSub_alldiv; 730 732 op_call(pSub_alldiv); 731 733 } … … 1000 1002 1001 1003 //call pow 1002 extern UserProc *pSub_pow;1004 extern const UserProc *pSub_pow; 1003 1005 op_call(pSub_pow); 1004 1006 … … 1156 1158 1157 1159 //call _allshl 1158 extern UserProc *pSub_allshl;1160 extern const UserProc *pSub_allshl; 1159 1161 op_call(pSub_allshl); 1160 1162 … … 1361 1363 1362 1364 //call _aullshr 1363 extern UserProc *pSub_aullshr;1365 extern const UserProc *pSub_aullshr; 1364 1366 op_call(pSub_aullshr); 1365 1367 } … … 1368 1370 1369 1371 //call _allshr 1370 extern UserProc *pSub_allshr;1372 extern const UserProc *pSub_allshr; 1371 1373 op_call(pSub_allshr); 1372 1374 } -
trunk/abdev/BasicCompiler32/NumOpe_Logical.cpp
r36 r206 1 #include "stdafx.h" 2 1 3 #include "../BasicCompiler_Common/common.h" 2 4 #include "Opcode.h" -
trunk/abdev/BasicCompiler32/NumOpe_Relation.cpp
r97 r206 1 #include "stdafx.h" 2 1 3 #include "../BasicCompiler_Common/common.h" 2 4 #include "Opcode.h" -
trunk/abdev/BasicCompiler32/NumOpe_TypeOperation.cpp
r183 r206 1 #include "stdafx.h" 2 1 3 #include <jenga/include/smoothie/Smoothie.h> 2 4 -
trunk/abdev/BasicCompiler32/Opcode.h
r142 r206 1 //Opcode.h 1 #pragma once 2 3 #include <Type.h> 4 #include <Procedure.h> 5 2 6 3 7 //未定義の定数情報 … … 201 205 bool _member_offset(bool isErrorEnabled, bool isWriteAccess, const CClass &objClass, const char *member, RELATIVE_VAR *pRelativeVar, Type &resultType, BOOL bPrivateAccess); 202 206 void SetThisPtrToReg(int reg); 203 bool GetVarOffset(bool isErrorEnabled,bool isWriteAccess,const char *NameBuffer,RELATIVE_VAR *pRelativeVar,Type &resultType, int *pss = 0);204 bool SetInitGlobalData(int offset,const Type &type,const int *SubScripts,const char *InitBuf);207 bool GetVarOffset(bool isErrorEnabled,bool isWriteAccess,const char *NameBuffer,RELATIVE_VAR *pRelativeVar,Type &resultType, Subscripts *pResultSubscripts = NULL ); 208 bool SetInitGlobalData(int offset,const Type &type,const Subscripts &subscripts,const char *InitBuf); 205 209 #define DIMFLAG_INITDEBUGVAR 1 206 210 #define DIMFLAG_NONCALL_CONSTRACTOR 2 207 211 #define DIMFLAG_STATIC 4 208 212 #define DIMFLAG_CONST 8 209 void dim( char *VarName, int *SubScripts,Type &type, const char *InitBuf,const char *ConstractParameter,DWORD dwFlags);213 void dim( char *VarName, const Subscripts &subscripts, Type &type, const char *InitBuf,const char *ConstractParameter,DWORD dwFlags); 210 214 void SetVarPtrToEax(RELATIVE_VAR *pRelativeVar); 211 215 void SetVarPtrToReg(int reg,RELATIVE_VAR *pRelativeVar); … … 234 238 bool EvaluateOverloadScore( int level, const Parameters &targetParms, const Type &targetResultType ); 235 239 public: 236 UserProc *_OverloadSolution( const char *name, std::vector<UserProc *> &subs, bool isEnabledReturnType = false );237 UserProc *OverloadSolution( const char *name, std::vector<UserProc *> &subs, bool isEnabledReturnType = false );240 const UserProc *_OverloadSolution( const char *name, std::vector<const UserProc *> &subs, bool isEnabledReturnType = false ); 241 const UserProc *OverloadSolution( const char *name, std::vector<const UserProc *> &subs, bool isEnabledReturnType = false ); 238 242 239 243 void ApplyDefaultParameters( const Parameters ¶ms ); … … 252 256 #define PROCFLAG_NEW 1 253 257 bool Opcode_CallProcPtr( const char *variable, const char *lpszParms,ProcPointer *pProcPointer); 254 bool Opcode_CallProc(const char *Parameter, UserProc *pUserProc,DWORD dwFlags,const char *ObjectName,int RefType);258 bool Opcode_CallProc(const char *Parameter,const UserProc *pUserProc,DWORD dwFlags,const char *ObjectName,int RefType); 255 259 bool Opcode_CallDllProc( const char *lpszParms, DllProc *pDllProc ); 256 260 … … 351 355 void fpu_cast_end(); 352 356 353 void op_call( UserProc *pUserProc);357 void op_call(const UserProc *pUserProc); 354 358 void op_ret(); -
trunk/abdev/BasicCompiler32/OperatorProc.cpp
r135 r206 1 #include "stdafx.h" 2 3 #include <jenga/include/smoothie/LexicalAnalysis.h> 4 1 5 #include "../BasicCompiler_Common/common.h" 2 6 #include "Opcode.h" … … 11 15 12 16 //call DestructorProcAddr 13 op_call( method->pUserProc);17 op_call( &method->GetUserProc() ); 14 18 } 15 19 … … 18 22 19 23 //call free 20 extern UserProc *pSub_free;24 extern const UserProc *pSub_free; 21 25 op_call(pSub_free); 22 26 } … … 27 31 pobj_c=(CClass *)index_stack[sp-2]; 28 32 29 std::vector< UserProc *> subs;33 std::vector<const UserProc *> subs; 30 34 pobj_c->GetMethods().Enum( idCalc, subs ); 31 35 if( subs.size() == 0 ){ … … 53 57 if(idCalc==CALC_EQUAL) lstrcpy(temporary,"=="); 54 58 else GetCalcName(idCalc,temporary); 55 UserProc *pUserProc = OverloadSolution( temporary, subs, params, baseType );59 const UserProc *pUserProc = OverloadSolution( temporary, subs, params, baseType ); 56 60 57 61 if(!pUserProc){ … … 107 111 108 112 //call calloc 109 extern UserProc *pSub_calloc;113 extern const UserProc *pSub_calloc; 110 114 op_call(pSub_calloc); 111 115 … … 249 253 } 250 254 void CallIndexerGetterProc(const CClass *pobj_Class,char *ObjectName,char *Parameter,Type &resultType){ 251 std::vector< UserProc *> subs;255 std::vector<const UserProc *> subs; 252 256 pobj_Class->GetMethods().Enum( CALC_ARRAY_GET, subs ); 253 257 if( subs.size() == 0 ){ -
trunk/abdev/BasicCompiler32/increment.cpp
r129 r206 1 #include "stdafx.h" 2 1 3 #include "../BasicCompiler_Common/common.h" 2 4 #include "Opcode.h" -
trunk/abdev/BasicCompiler32/op32_main.cpp
r142 r206 1 #include "stdafx.h" 2 1 3 #include "../BasicCompiler_Common/common.h" 2 4 #include "Opcode.h" … … 980 982 ///////////////////////////// 981 983 982 void op_call( UserProc *pUserProc){984 void op_call(const UserProc *pUserProc){ 983 985 OpBuffer[obp++]=(char)0xE8; 984 986 pobj_SubAddrSchedule->add(pUserProc,1);
Note:
See TracChangeset
for help on using the changeset viewer.