Changeset 99 in dev for BasicCompiler_Common
- Timestamp:
- Apr 19, 2007, 3:09:55 AM (18 years ago)
- Location:
- BasicCompiler_Common
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/BasicFixed.h
r69 r99 129 129 130 130 //以下制御用エスケープシーケンス 131 #define ESC_MOD '1' //MOD 演算子 132 #define ESC_AND '&' //AND 演算子 133 #define ESC_OR '3' //OR 演算子 134 #define ESC_XOR '4' //XOR 演算子 135 #define ESC_NOT '5' //NOT 演算子 136 #define ESC_AS '6' //AS(区切り文字) 137 #define ESC_THEN 2 //Then 138 #define ESC_ELSE 3 //Else 139 #define ESC_IF 'A' //If 140 #define ESC_ELSEIF 'B' //ElseIf 141 #define ESC_ENDIF 'C' //End If 142 #define ESC_DEF 'D' //Def 143 #define ESC_DECLARE 'E' //Declare 144 #define ESC_SUB 'F' //Sub 145 #define ESC_ENDSUB 'G' //End Sub 146 #define ESC_EXITSUB 'H' //Exit Sub 147 #define ESC_FUNCTION 'I' //Function 148 #define ESC_ENDFUNCTION 'J' //End Function 149 #define ESC_EXITFUNCTION 'K'//Exit Function 150 #define ESC_BYVAL 'L' //ByVal 151 #define ESC_BYREF 'M' //ByRef 152 #define ESC_TYPE 'N' //Type 153 #define ESC_ENDTYPE 'O' //End Type 154 #define ESC_EXITFOR 'P' //Exit For 155 #define ESC_EXITWHILE 'Q' //Exit Wend 156 #define ESC_EXITDO 'R' //Exit Do 157 #define ESC_SELECTCASE 'S' //Select Case 158 #define ESC_CASE 'T' //Case 159 #define ESC_CASEELSE 'U' //Case Else 160 #define ESC_ENDSELECT 'V' //End Select 161 #define ESC_CONST 'W' //Const 162 #define ESC_WITH 'X' //With 163 #define ESC_ENDWITH 'Y' //End With 164 #define ESC_CDECL 'Z' //cdecl規約 165 #define ESC_MACRO 'a' //Macro 166 #define ESC_ENDMACRO 'b' //End Macro 167 #define ESC_EXITMACRO 'c' //Exit Macro 168 #define ESC_EXPORT 'd' //Export 169 #define ESC_CONTINUE 'e' //Continue 170 #define ESC_PSMEM 'f' //"->" Member of Pointer Struct(構造体ポインタのメンバ参照) 171 #define ESC_STATIC 'g' //Static 172 #define ESC_TYPEDEF 'h' //TypeDef 173 #define ESC_TRY 'i' //Try 174 #define ESC_CATCH 'j' //Catch 175 #define ESC_FINALLY 'k' //Finally 176 #define ESC_THROW 'l' //Throw 177 #define ESC_ENDTRY 'm' //End Try 131 #define ESC_MOD '1' // MOD 演算子 132 #define ESC_AND '&' // AND 演算子 133 #define ESC_OR '3' // OR 演算子 134 #define ESC_XOR '4' // XOR 演算子 135 #define ESC_NOT '5' // NOT 演算子 136 #define ESC_AS '6' // AS(区切り文字) 137 #define ESC_THEN 2 // Then 138 #define ESC_ELSE 3 // Else 139 #define ESC_IF 'A' // If 140 #define ESC_ELSEIF 'B' // ElseIf 141 #define ESC_ENDIF 'C' // End If 142 #define ESC_DEF 'D' // Def 143 #define ESC_DECLARE 'E' // Declare 144 #define ESC_SUB 'F' // Sub 145 #define ESC_ENDSUB 'G' // End Sub 146 #define ESC_EXITSUB 'H' // Exit Sub 147 #define ESC_FUNCTION 'I' // Function 148 #define ESC_ENDFUNCTION 'J' // End Function 149 #define ESC_EXITFUNCTION 'K' // Exit Function 150 #define ESC_BYVAL 'L' // ByVal 151 #define ESC_BYREF 'M' // ByRef 152 #define ESC_TYPE 'N' // Type 153 #define ESC_ENDTYPE 'O' // End Type 154 #define ESC_EXITFOR 'P' // Exit For 155 #define ESC_EXITWHILE 'Q' // Exit Wend 156 #define ESC_EXITDO 'R' // Exit Do 157 #define ESC_SELECTCASE 'S' // Select Case 158 #define ESC_CASE 'T' // Case 159 #define ESC_CASEELSE 'U' // Case Else 160 #define ESC_ENDSELECT 'V' // End Select 161 #define ESC_CONST 'W' // Const 162 #define ESC_WITH 'X' // With 163 #define ESC_ENDWITH 'Y' // End With 164 #define ESC_CDECL 'Z' // cdecl規約 165 #define ESC_MACRO 'a' // Macro 166 #define ESC_ENDMACRO 'b' // End Macro 167 #define ESC_EXITMACRO 'c' // Exit Macro 168 #define ESC_EXPORT 'd' // Export 169 #define ESC_CONTINUE 'e' // Continue 170 #define ESC_PSMEM 'f' // "->" Member of Pointer Struct(構造体ポインタのメンバ参照) 171 #define ESC_STATIC 'g' // Static 172 #define ESC_TYPEDEF 'h' // TypeDef 173 #define ESC_TRY 'i' // Try 174 #define ESC_CATCH 'j' // Catch 175 #define ESC_FINALLY 'k' // Finally 176 #define ESC_THROW 'l' // Throw 177 #define ESC_ENDTRY 'm' // End Try 178 #define ESC_NAMESPACE 'o' // Namespace 179 #define ESC_ENDNAMESPACE 'p' // End Namespace 178 180 //EXEファイル用制御エスケープシーケンス 179 #define ESC_USING 'o' //Print命令語のUsing180 #define ESC_FOR 'p' //Open命令語のFor181 #define ESC_LINENUM 'q' //行番号を示す181 #define ESC_USING 'q' // Print命令語のUsing 182 #define ESC_FOR 'r' // Open命令語のFor 183 #define ESC_LINENUM 's' // 行番号を示す 182 184 183 185 //オブジェクト指向エスケープシーケンス -
BasicCompiler_Common/Compile.cpp
r89 r99 219 219 break; 220 220 case ESC_DECLARE: 221 break; 222 223 case ESC_NAMESPACE: 224 case ESC_ENDNAMESPACE: 221 225 break; 222 226 -
BasicCompiler_Common/Intermediate_Step1.cpp
r96 r99 320 320 char *temporary,temp2[VN_SIZE]; 321 321 322 bool isBeforeCharDelimitation = false; 322 323 temporary=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,lstrlen(buffer)*2); 323 324 for(i=0,i2=0,IsStr=0;;i++,i2++){ … … 327 328 buffer[i+1]=ESC_PSMEM; 328 329 } 330 331 if( buffer[i] && IsCommandDelimitation( buffer[i] ) ){ 332 isBeforeCharDelimitation = true; 333 334 temporary[i2]=buffer[i]; 335 continue; 336 } 337 329 338 if(IsVariableChar(buffer[i])&&IsStr==0){ 339 330 340 i3=i2; 331 341 for(;;i++,i2++){ … … 336 346 temporary[i2]=buffer[i]; 337 347 } 348 349 bool isAfterCharBlank = false; 350 if( IsBlank( buffer[i] ) ){ 351 isAfterCharBlank = true; 352 } 353 338 354 if(lstrcmpi(temporary+i3,"End")==0) i6=1; 339 355 else if(lstrcmpi(temporary+i3,"Exit")==0) i6=2; … … 389 405 if(lstrcmpi(temp2,"Macro")==0) sw1=1; 390 406 break; 407 case 'n': 408 case 'N': 409 if(lstrcmpi(temp2,"Namespace")==0) sw1=1; 410 break; 391 411 case 's': 392 412 case 'S': … … 642 662 temporary[i2]=ESC_ENDMACRO; 643 663 } 664 else if(lstrcmpi(temporary+i3,"EndNamespace")==0){ 665 i2=i3; 666 temporary[i2++]=1; 667 temporary[i2]=ESC_ENDNAMESPACE; 668 } 644 669 else if(lstrcmpi(temporary+i3,"EndClass")==0){ 645 670 i2=i3; … … 757 782 case 'n': 758 783 case 'N': 759 if(lstrcmpi(temporary+i3,"New")==0){ 784 if(isBeforeCharDelimitation 785 && lstrcmpi(temporary+i3,"Namespace")==0 786 && isAfterCharBlank ){ 787 i2=i3; 788 temporary[i2++]=1; 789 temporary[i2]=ESC_NAMESPACE; 790 } 791 else if(lstrcmpi(temporary+i3,"New")==0){ 760 792 i2=i3; 761 793 temporary[i2++]=1; … … 868 900 continue; 869 901 } 902 903 if( !IsBlank( buffer[i] ) ){ 904 isBeforeCharDelimitation = false; 905 } 906 870 907 temporary[i2]=buffer[i]; 871 908 if(buffer[i]=='\0') break; -
BasicCompiler_Common/Subroutine.cpp
r97 r99 659 659 MacroNum=0; 660 660 661 // 名前空間管理 662 vector<string> namespaceScopes; 663 661 664 i=-1; 662 665 while(1){ … … 679 682 } 680 683 684 if( basbuf[i] == 1 && basbuf[i+1] == ESC_NAMESPACE ){ 685 for(i+=2,i2=0;;i2++,i++){ 686 if( IsCommandDelimitation( basbuf[i] ) ){ 687 temporary[i2]=0; 688 break; 689 } 690 temporary[i2]=basbuf[i]; 691 } 692 namespaceScopes.push_back( temporary ); 693 694 continue; 695 } 696 else if( basbuf[i] == 1 && basbuf[i+1] == ESC_ENDNAMESPACE ){ 697 if( namespaceScopes.size() <= 0 ){ 698 SetError(12, "End Namespace", i ); 699 } 700 else{ 701 namespaceScopes.pop_back(); 702 } 703 704 i += 2; 705 continue; 706 } 707 681 708 if(basbuf[i]==1&&basbuf[i+1]==ESC_DECLARE){ 682 709 for(i+=2,i2=0;;i2++,i++){
Note:
See TracChangeset
for help on using the changeset viewer.