Changeset 31 in dev for BasicCompiler32
- Timestamp:
- Jan 13, 2007, 4:26:50 AM (18 years ago)
- Location:
- BasicCompiler32
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler32/CParameter.cpp
r28 r31 215 215 SUBINFO *psi; 216 216 psi=0; 217 if(lstrcmp(name,"Abs")==0){ 218 MessageBeep(0); 219 } 217 220 218 for(i=0;i<num;i++){ 221 219 psi=ppsi[i]; -
BasicCompiler32/Compile_CallProc.cpp
r29 r31 67 67 68 68 69 ret_type=Opcode_CallProc(Parameter,psi,plpRetIndex,0,ObjectName,RefType); 69 Opcode_CallProc(Parameter,psi,0,ObjectName,RefType); 70 if( plpRetIndex ){ 71 *plpRetIndex = psi->u.ReturnIndex; 72 } 73 return psi->ReturnType; 70 74 } 71 75 else if(idProc==PROC_DLL){ … … 138 142 if(psi){ 139 143 //呼び出し 140 int type; 141 LONG_PTR lpIndex; 142 type=Opcode_CallProc(Parameter,psi,&lpIndex,0,ObjectName,RefType); 144 Opcode_CallProc(Parameter,psi,0,ObjectName,RefType); 143 145 144 146 if(pRetTypeInfo){ 145 pRetTypeInfo->type =type;146 pRetTypeInfo->u.lpIndex =lpIndex;147 pRetTypeInfo->type = psi->ReturnType; 148 pRetTypeInfo->u.lpIndex = psi->u.ReturnIndex; 147 149 } 148 150 } … … 174 176 175 177 //エラーチェック 176 pobj_parameter->ErrorCheck(variable,pi->pParmInfo,pi->ParmNum,pi->ParmNum); 178 if( !pobj_parameter->ErrorCheck(variable,pi->pParmInfo,pi->ParmNum,pi->ParmNum) ){ 179 //パラメータにエラーがあるときは処理を終える 180 return pi->ReturnType; 181 } 177 182 178 183 //一時オブジェクトを生成 … … 213 218 } 214 219 215 int Opcode_CallProc(char *Parameter,SUBINFO *psi,LONG_PTR *plpIndex,DWORD dwFlags,char *ObjectName,int RefType){220 void Opcode_CallProc(char *Parameter,SUBINFO *psi,DWORD dwFlags,char *ObjectName,int RefType){ 216 221 int i,i2; 217 222 … … 219 224 if(lstrcmpi(psi->name,"Print")==0){ 220 225 Opcode_Print(Parameter,0); 221 return -1;226 return; 222 227 } 223 228 if(lstrcmpi(psi->name,"Input")==0){ 224 229 Opcode_Input(Parameter); 225 return -1;230 return; 226 231 } 227 232 if(lstrcmpi(psi->name,"Write")==0){ 228 233 Opcode_Print(Parameter,1); 229 return -1;234 return; 230 235 } 231 236 } … … 277 282 if( !pMethod ){ 278 283 SetError(300,NULL,cp); 279 return -1;284 return; 280 285 } 281 286 … … 296 301 if(dwAccess==ACCESS_NON){ 297 302 SetError(109,psi->name,cp); 298 return -1;303 return; 299 304 } 300 305 } … … 303 308 dwAccess==ACCESS_NON){ 304 309 SetError(109,psi->name,cp); 305 return -1;310 return; 306 311 } 307 312 if(dwAccess==ACCESS_PROTECTED){ 308 313 SetError(110,psi->name,cp); 309 return -1;314 return; 310 315 } 311 316 } … … 315 320 if(dwAccess==ACCESS_NON){ 316 321 SetError(109,psi->name,cp); 317 return -1;322 return; 318 323 } 319 324 } … … 352 357 353 358 //エラーチェック 354 pobj_parameter->ErrorCheck(psi->name,psi->pRealParmInfo,psi->RealParmNum,psi->RealSecondParmNum); 359 if( !pobj_parameter->ErrorCheck(psi->name,psi->pRealParmInfo,psi->RealParmNum,psi->RealSecondParmNum) ){ 360 //パラメータにエラーがあるときは処理を終える 361 return; 362 } 355 363 356 364 if(psi->dwType==SUBTYPE_MACRO){ … … 401 409 if( pMethod->isConst ){ 402 410 //Constアクセスが可能なメソッドの場合 403 if( !GetVarOffsetReadOnly( ObjectName, &i2, &RelativeVar, 0 ) ) return -1;411 if( !GetVarOffsetReadOnly( ObjectName, &i2, &RelativeVar, 0 ) ) return; 404 412 } 405 413 else{ 406 414 //Constアクセスが不可能なメソッドの場合 407 if( !GetVarOffsetReadWrite( ObjectName, &i2, &RelativeVar, 0 ) ) return -1;415 if( !GetVarOffsetReadWrite( ObjectName, &i2, &RelativeVar, 0 ) ) return; 408 416 } 409 417 … … 488 496 //パラメータオブジェクトを破棄 489 497 delete pobj_parameter; 490 491 if(plpIndex) *plpIndex=psi->u.ReturnIndex;492 493 return psi->ReturnType;494 498 } 495 499 … … 516 520 517 521 //エラーチェック 518 pobj_parameter->ErrorCheck(pdi->name,pdi->pParmInfo,pdi->ParmNum,pdi->ParmNum); 522 if( !pobj_parameter->ErrorCheck(pdi->name,pdi->pParmInfo,pdi->ParmNum,pdi->ParmNum) ){ 523 //パラメータにエラーがあるときは処理を終える 524 return pdi->ReturnType; 525 } 519 526 520 527 //レジスタ、スタックフレームにセット -
BasicCompiler32/Compile_Object.cpp
r28 r31 47 47 Opcode_CallProc(CreateParameter, 48 48 psi, 49 0,50 49 PROCFLAG_NEW,"",0); 51 50 -
BasicCompiler32/Compile_ProcOp.cpp
r28 r31 492 492 pobj_CompilingClass->ppobj_Method[i3]->psi, 493 493 0, 494 0,495 494 "", 496 495 0); … … 502 501 pobj_CompilingClass->ppobj_Method[i3]->psi, 503 502 0, 504 0,505 503 "", 506 504 0); … … 613 611 Opcode_CallProc("", 614 612 pobj_CompilingClass->ppobj_Method[i3]->psi, 615 0,616 613 0, 617 614 "", -
BasicCompiler32/Compile_Statement.cpp
r11 r31 60 60 if(psi->dwType!=SUBTYPE_MACRO) SetError(10,Command,cp); 61 61 62 Opcode_CallProc("",psi,0, 0,"",0);62 Opcode_CallProc("",psi,0,"",0); 63 63 64 64 return; … … 1210 1210 } 1211 1211 1212 PARAMETER_INFO *ppi ;1212 PARAMETER_INFO *ppi = (PARAMETER_INFO *)HeapAlloc(hHeap,0,sizeof(PARAMETER_INFO)*3); 1213 1213 int iParmNum=0; 1214 1215 //_System_LocalThis1216 ppi=(PARAMETER_INFO *)HeapAlloc(hHeap,0,sizeof(PARAMETER_INFO)*3);1217 ppi[iParmNum].bArray=0;1218 ppi[iParmNum].bByVal=0;1219 ppi[iParmNum].name=0;1220 ppi[iParmNum].type=DEF_PTR_VOID;1221 ppi[iParmNum].u.index=-1;1222 ppi[iParmNum].SubScripts[0]=-1;1223 iParmNum++;1224 1225 1214 ppi[iParmNum].bArray=0; 1226 1215 ppi[iParmNum].bByVal=0; … … 1600 1589 return; 1601 1590 } 1602 Opcode_CallProc(buffer,psi,0, 0,"",0);1591 Opcode_CallProc(buffer,psi,0,"",0); 1603 1592 } 1604 1593 void Opcode_PrintUsing(char *Parameter,char *buffer,BOOL bFile){ … … 1699 1688 return; 1700 1689 } 1701 Opcode_CallProc(buffer,psi,0, 0,"",0);1690 Opcode_CallProc(buffer,psi,0,"",0); 1702 1691 } 1703 1692 void Opcode_Print(char *Parameter,BOOL bWrite){ … … 1805 1794 return; 1806 1795 } 1807 Opcode_CallProc(buffer,psi,0, 0,"",0);1796 Opcode_CallProc(buffer,psi,0,"",0); 1808 1797 } 1809 1798 -
BasicCompiler32/Opcode.h
r20 r31 225 225 #define PROCFLAG_NEW 1 226 226 int Opcode_CallProcPtr(char *variable,char *Parameter,PROCPTRINFO *pi,LONG_PTR *plpIndex); 227 int Opcode_CallProc(char *Parameter,SUBINFO *psi,LONG_PTR *plpIndex,DWORD dwFlags,char *ObjectName,int RefType);227 void Opcode_CallProc(char *Parameter,SUBINFO *psi,DWORD dwFlags,char *ObjectName,int RefType); 228 228 int Opcode_CallDllProc(char *Parameter,DECLAREINFO *pdi,LONG_PTR *plpIndex); 229 229 -
BasicCompiler32/OperatorProc.cpp
r3 r31 64 64 ///////////////////////////////////////////// 65 65 66 PARAMETER_INFO *ppi ;66 PARAMETER_INFO *ppi = (PARAMETER_INFO *)HeapAlloc(hHeap,0,sizeof(PARAMETER_INFO)*3); 67 67 int iParmNum=0; 68 69 //_System_LocalThis70 ppi=(PARAMETER_INFO *)HeapAlloc(hHeap,0,sizeof(PARAMETER_INFO)*3);71 ppi[iParmNum].bArray=0;72 ppi[iParmNum].bByVal=0;73 ppi[iParmNum].name=0;74 ppi[iParmNum].type=DEF_PTR_VOID;75 ppi[iParmNum].u.index=-1;76 ppi[iParmNum].SubScripts[0]=-1;77 iParmNum++;78 68 79 69 if(bTwoTerm){ … … 282 272 } 283 273 284 RetTypeInfo.type=Opcode_CallProc(Parameter,ppsi[0],&RetTypeInfo.u.lpIndex,0,ObjectName,DEF_OBJECT); 274 Opcode_CallProc(Parameter,ppsi[0],0,ObjectName,DEF_OBJECT); 275 RetTypeInfo.type=ppsi[0]->ReturnType; 276 RetTypeInfo.u.lpIndex = ppsi[0]->u.ReturnIndex; 285 277 286 278 HeapDefaultFree(ppsi);
Note:
See TracChangeset
for help on using the changeset viewer.