Changeset 54 in dev for BasicCompiler_Common
- Timestamp:
- Feb 12, 2007, 2:09:55 PM (18 years ago)
- Location:
- BasicCompiler_Common
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/Intermediate_Step1.cpp
r4 r54 414 414 char *temporary,temp2[VN_SIZE]; 415 415 416 temporary=(char *) GlobalAlloc(GMEM_FIXED,lstrlen(buffer)*2);416 temporary=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,lstrlen(buffer)*2); 417 417 for(i=0,i2=0,IsStr=0;;i++,i2++){ 418 418 if(buffer[i]=='\"') IsStr^=1; … … 594 594 if(lstrcmpi(temporary+i3,"Declare")==0){ 595 595 i2=i3; 596 int i9=i2; 596 597 temporary[i2]=1; 597 598 temporary[++i2]=ESC_DECLARE; 598 599 i++; 599 600 while(buffer[i]==' '||buffer[i]=='\t') i++; 601 602 // Sub/Function 600 603 for(i4=0;;i++,i4++){ 601 604 if(!IsVariableChar(buffer[i])){ … … 608 611 else if(lstrcmpi(temp2,"Function")==0) temporary[++i2]=ESC_FUNCTION; 609 612 while(buffer[i]==' '||buffer[i]=='\t') i++; 613 614 // 関数名 610 615 for(i2++;;i++,i2++){ 611 616 if(!IsVariableChar(buffer[i])){ … … 616 621 } 617 622 while(buffer[i]==' '||buffer[i]=='\t') i++; 623 618 624 for(i4=0;;i++,i4++){ 619 625 if(!IsVariableChar(buffer[i])){ … … 638 644 if(lstrcmpi(temp2,"Lib")==0) temporary[++i2]=','; 639 645 while(buffer[i]==' '||buffer[i]=='\t') i++; 646 640 647 if(buffer[i]=='\"'){ 641 648 temporary[++i2]=buffer[i]; … … 649 656 } 650 657 } 658 else{ 659 for(i2++;;i++,i2++){ 660 if(!IsVariableChar(buffer[i])){ 661 i2--; 662 break; 663 } 664 temporary[i2]=buffer[i]; 665 } 666 } 651 667 while(buffer[i]==' '||buffer[i]=='\t') i++; 652 for(i4=0;;i++,i4++){ 653 if(!IsVariableChar(buffer[i])){ 654 temp2[i4]=0; 655 break; 668 669 temporary[++i2]=','; 670 671 if( memicmp( buffer + i, "Alias", 5 ) ==0 ){ 672 i+=5; 673 for(i++,i2++;;i++,i2++){ 674 temporary[i2]=buffer[i]; 675 if(buffer[i]=='('){ 676 i2--; 677 break; 678 } 679 if(buffer[i]=='\0') break; 656 680 } 657 temp2[i4]=buffer[i];658 } 659 if(lstrcmpi(temp2,"Alias")==0)660 temporary[++i2]=','; 681 } 682 683 temporary[++i2]=','; 684 661 685 i--; 662 686 } … … 942 966 } 943 967 lstrcpy(buffer,temporary); 944 GlobalFree(temporary);968 HeapDefaultFree(temporary); 945 969 } 946 970 void DefCommandFormat(char *buffer){ -
BasicCompiler_Common/Subroutine.cpp
r50 r54 455 455 456 456 //ライブラリ 457 if(buffer[i]!='\"'){ 457 i = GetOneParameter( buffer, i, temporary ); 458 int type; 459 LONG_PTR lpIndex; 460 _int64 i64data; 461 type = StaticCalculation( true, temporary, 0, &i64data, &lpIndex ); 462 if( type != DEF_PTR_BYTE ){ 458 463 SetError(1,NULL,NowLine); 459 464 return; 460 465 } 461 for(i++,i2=0;;i++,i2++){ 462 if(buffer[i]=='\"'){ 463 temporary[i2]=0; 464 break; 465 } 466 if(buffer[i]=='\0'){ 467 SetError(1,NULL,NowLine); 468 return; 469 } 470 temporary[i2]=buffer[i]; 471 } 466 lstrcpy( temporary, (char *)i64data ); 472 467 CharUpper(temporary); 473 468 if(!strstr(temporary,".")){ … … 483 478 pdi->file=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1); 484 479 lstrcpy(pdi->file,temporary); 485 i++; 486 487 if(buffer[i]==','){ 488 i++; 489 if(buffer[i]!='\"'){ 480 481 //エイリアス 482 i = GetOneParameter( buffer, i, temporary ); 483 if( temporary[0] ){ 484 type = StaticCalculation( true, temporary, 0, &i64data, &lpIndex ); 485 if( type != DEF_PTR_BYTE ){ 490 486 SetError(1,NULL,NowLine); 491 487 return; 492 488 } 493 for(i++,i2=0;;i++,i2++){ 494 if(buffer[i]=='\"'){ 495 temporary[i2]=0; 496 break; 497 } 498 if(buffer[i]=='\0'){ 499 SetError(1,NULL,NowLine); 500 return; 501 } 502 temporary[i2]=buffer[i]; 503 } 489 lstrcpy( temporary, (char *)i64data ); 490 504 491 pdi->alias=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1); 505 492 lstrcpy(pdi->alias,temporary); 506 i++;507 493 } 508 494 else{ 495 //省略されたときは関数名 509 496 pdi->alias=(char *)HeapAlloc(hHeap,0,lstrlen(pdi->name)+1); 510 497 lstrcpy(pdi->alias,pdi->name);
Note:
See TracChangeset
for help on using the changeset viewer.