Changeset 122 in dev for BasicCompiler64/Compile_Statement.cpp
- Timestamp:
- May 13, 2007, 1:50:02 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler64/Compile_Statement.cpp
r97 r122 4 4 void OpcodeOthers(char *Command){ 5 5 int i,i2; 6 char buffer[8192];7 6 UserProc *pUserProc; 8 7 8 char leftTerm[8192]; 9 int lastParePos = 0; 9 10 for(i=0;;i++){ 10 if(Command[i]=='['){ 11 i2=GetStringInBracket(buffer+i,Command+i); 11 if(Command[i]=='\"'){ 12 //ダブルクォートは不正なのでエラー扱い 13 leftTerm[i]=0; 14 SetError(3,leftTerm,cp); 15 return; 16 } 17 18 if(Command[i]=='('){ 19 lastParePos = i; 20 i2=GetStringInPare(leftTerm+i,Command+i); 12 21 i+=i2-1; 13 22 continue; 14 23 } 15 if(Command[i]==1&&Command[i+1]==ESC_PSMEM){ 16 buffer[i]=Command[i]; 17 i++; 18 buffer[i]=Command[i]; 24 if(Command[i]=='['){ 25 i2=GetStringInBracket(leftTerm+i,Command+i); 26 i+=i2-1; 19 27 continue; 20 28 } 21 if( !IsVariableChar(Command[i])){22 buffer[i]=0;29 if(Command[i]=='\0'){ 30 leftTerm[i] = 0; 23 31 break; 24 32 } 25 buffer[i]=Command[i]; 26 } 27 33 34 if( IsNumCalcMark( Command, i ) ){ 35 leftTerm[i] = 0; 36 break; 37 } 38 39 leftTerm[i]=Command[i]; 40 } 28 41 if(!( 29 IsVariableTopChar( buffer[0])||30 buffer[0]=='.'||31 ( buffer[0]==1&&buffer[1]==ESC_PSMEM)42 IsVariableTopChar(leftTerm[0])|| 43 leftTerm[0]=='.'|| 44 (leftTerm[0]==1&&leftTerm[1]==ESC_PSMEM) 32 45 )){ 33 46 SetError(1,NULL,cp); … … 36 49 37 50 38 if(Command[i]=='\0' ){51 if(Command[i]=='\0' && lastParePos == 0){ 39 52 ////////////////////////////// 40 53 // パラメータ無しのマクロ検索 … … 73 86 } 74 87 75 int idProc; 76 void *pProc; 77 idProc=GetProc(buffer,(void **)&pProc); 78 79 int i4; 80 char temp2[VN_SIZE]; 81 if(idProc){ 82 if(Command[i]!='('){ 83 SetError(10,buffer,cp); 84 return; 85 } 86 i4=GetStringInPare_RemovePare(temp2,Command+i+1); 87 88 //閉じカッコ")"に続く文字がNULLでないときはエラーにする 89 if(Command[i+1+i4+1]!='\0') SetError(42,NULL,cp); 90 91 //////////////// 92 // 呼び出し 93 //////////////// 94 95 Type resultType; 96 CallProc(idProc,pProc,buffer,temp2,resultType); 97 88 if( pobj_reg ){ 89 SetError(); 90 } 91 pobj_reg=new CRegister(REG_RAX); 92 93 Type resultType; 94 bool isLiteral; 95 BOOL bUseHeap; 96 bool result = TermOpe( leftTerm, Type(), resultType, isLiteral, &bUseHeap, NULL, true ); 97 98 delete pobj_reg; 99 pobj_reg = NULL; 100 101 if( result ){ 98 102 99 103 ///////////////////// … … 107 111 FreeTempObject(REG_R14,&resultType.GetClass()); 108 112 } 109 return; 110 } 111 112 113 ////////////////////////// 114 // その他は代入演算を行う 115 ////////////////////////// 116 OpcodeCalc(Command); 113 114 //成功 115 return; 116 } 117 118 // 失敗 119 SetError(1, NULL,cp); 117 120 } 118 121
Note:
See TracChangeset
for help on using the changeset viewer.