Changeset 15 in dev for BasicCompiler_Common/Compile.cpp
- Timestamp:
- Dec 11, 2006, 3:07:59 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/Compile.cpp
r7 r15 392 392 BufferSize=128; 393 393 Command=(char *)HeapAlloc(hHeap,0,BufferSize); 394 /* 395 i = CSource::obj.GetTokenIndex(cp); 396 CToken *ptoken; 397 do{ 398 //次のトークン 399 ptoken = CSource::obj.GetToken(i++); 400 401 //ステップ区切り(改行またはコロン)の場合 402 while(ptoken->GetType() == TOKEN_DELIMITATION){ 403 ptoken = CSource::obj.GetToken(i++); 404 continue; 405 } 406 407 if(ptoken->GetType() == TOKEN_ESCAPESEQUENCE){ 408 //////////////////////////// 409 // 特殊記号 410 //////////////////////////// 411 412 if(ptoken->GetExtended() == ESC_LINENUM){ 413 414 //行番号 415 ptoken = CSource::obj.GetToken(i++); 416 417 i3=atoi(ptoken->ToString()); 418 i4=i+1; 419 420 //Goto先ラベル 421 pLabelNames=(LABEL *)HeapReAlloc(hHeap,0,pLabelNames,(MaxLabelNum+1)*sizeof(LABEL)); 422 pLabelNames[MaxLabelNum].pName=0; 423 pLabelNames[MaxLabelNum].line=i3; 424 pLabelNames[MaxLabelNum].address=obp; 425 MaxLabelNum++; 426 427 //書き込みスケジュール 428 for(i=0;i<GotoLabelScheduleNum;i++){ 429 if(pGotoLabelSchedule[i].pName==0&& 430 pGotoLabelSchedule[i].line==i3){ 431 *((long *)(OpBuffer+pGotoLabelSchedule[i].pos))=obp-(pGotoLabelSchedule[i].pos+sizeof(long)); 432 433 //詰める 434 GotoLabelScheduleNum--; 435 for(i2=i;i2<GotoLabelScheduleNum;i2++){ 436 pGotoLabelSchedule[i2].pName=pGotoLabelSchedule[i2+1].pName; 437 pGotoLabelSchedule[i2].line=pGotoLabelSchedule[i2+1].line; 438 pGotoLabelSchedule[i2].pos=pGotoLabelSchedule[i2+1].pos; 439 } 440 i--; 441 } 442 } 443 444 //カンマ 445 i++; 446 447 //次のトークン 448 ptoken = CSource::obj.GetToken(i++); 449 } 450 } 451 }while(ptoken->GetType() == TOKEN_EOF); 452 */ 394 453 for(cp++,i2=0;;cp++,i2++){ 395 454 if(i2>=BufferSize){
Note:
See TracChangeset
for help on using the changeset viewer.