Changeset 415 in dev for trunk/abdev/BasicCompiler32/NumOpe.cpp
- Timestamp:
- Mar 6, 2008, 11:19:38 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler32/NumOpe.cpp
r412 r415 140 140 return true; 141 141 } 142 bool TermMemberOpe( const Type &leftType, const Type &baseType, Type &resultType, const char *termFull, const char *termLeft, const char *member )142 bool TermMemberOpe( const Type &leftType, const Type &baseType, Type &resultType, const char *termFull, const char *termLeft, const char *member, bool &isVariable, RELATIVE_VAR &relativeVar ) 143 143 { 144 144 const CClass &objClass = leftType.GetClass(); … … 179 179 compiler.codeGenerator.op_mov_RR( REG_ECX, useReg ); 180 180 181 RELATIVE_VAR relativeVar;182 relativeVar.dwKind=VAR_DIRECTMEM;181 RELATIVE_VAR tempRelativeVar; 182 tempRelativeVar.dwKind=VAR_DIRECTMEM; 183 183 184 184 if( !_member_offset( … … 186 186 false, //読み込み専用 187 187 leftType, 188 VarName,& relativeVar,classType,0)){188 VarName,&tempRelativeVar,classType,0)){ 189 189 return false; 190 190 } 191 191 192 192 // オブジェクトメンバのポインタをeaxにコピー 193 if( !VarToReg( relativeVar, baseType, resultType ) ){193 if( !VarToReg( tempRelativeVar, baseType, resultType ) ){ 194 194 SetError(11,termFull,cp); 195 195 } … … 225 225 compiler.codeGenerator.op_mov_RR( REG_ECX, useReg ); 226 226 227 RELATIVE_VAR relativeVar;228 227 relativeVar.dwKind=VAR_DIRECTMEM; 229 228 … … 236 235 } 237 236 238 if( !VarToReg( relativeVar, baseType, resultType ) ){ 239 SetError(11,termFull,cp); 240 } 237 // 変数として扱う 238 isVariable = true; 241 239 242 240 return true; … … 271 269 272 270 // まずはプロパティ値を取得 273 TermMemberOpe( leftType, baseType, resultType, termFull, termLeft, methodName ); 271 bool dummyIsVariable; 272 RELATIVE_VAR dummyRelativeVar; 273 TermMemberOpe( leftType, baseType, resultType, termFull, termLeft, methodName, dummyIsVariable, dummyRelativeVar ); 274 274 275 275 // 戻り値のオブジェクトインスタンスのインデクサを呼び出す … … 278 278 sprintf( temp2, "%s.%s", termLeft, methodName ); 279 279 Type classType = resultType; 280 return TermMemberOpe( classType, baseType, resultType, termFull, temp2, temporary );280 return TermMemberOpe( classType, baseType, resultType, termFull, temp2, temporary, isVariable, relativeVar ); 281 281 } 282 282 … … 324 324 return false; 325 325 } 326 bool TermOpe( const char *term, const Type &baseType, Type &resultType, bool &isLiteral, BOOL *pbUseHeap, bool isWantObject, bool *pIsClassName, bool isProcedureCallOnly ){ 326 bool _TermOpe( const char *term, const Type &baseType, Type &resultType, bool &isLiteral, BOOL *pbUseHeap, bool *pIsClassName, bool isProcedureCallOnly, bool &isVariable, RELATIVE_VAR &relativeVar, bool isWriteAccess ) 327 { 327 328 char parameter[VN_SIZE]; 328 329 … … 364 365 } 365 366 366 if( !TermOpe( termLeft, baseType, leftType, isLiteral, pbUseHeap, true,&isClassName ) ){367 if( !TermOpe( termLeft, baseType, leftType, isLiteral, pbUseHeap, &isClassName ) ){ 367 368 goto globalArea; 368 369 } … … 382 383 } 383 384 384 return TermMemberOpe( leftType, baseType, resultType, termFull, termLeft, member );385 return TermMemberOpe( leftType, baseType, resultType, termFull, termLeft, member, isVariable, relativeVar ); 385 386 } 386 387 globalArea: … … 545 546 //////////////////////////////// 546 547 547 RELATIVE_VAR relativeVar;548 548 if(GetVarOffset( 549 549 false, //エラー表示なし 550 false, //読み込み専用550 isWriteAccess, 551 551 termFull, 552 552 &relativeVar,resultType)){ … … 555 555 ////////// 556 556 557 if( !VarToReg( relativeVar, baseType, resultType ) ){ 558 SetError(11,termFull,cp); 559 } 557 // 変数として扱う 558 isVariable = true; 560 559 561 560 isLiteral = false; … … 610 609 611 610 return false; 611 } 612 613 bool TermOpe( const char *term, const Type &baseType, Type &resultType, bool &isLiteral, BOOL *pbUseHeap, bool *pIsClassName, bool isProcedureCallOnly, bool isWriteAccess ) 614 { 615 RELATIVE_VAR relativeVar; 616 bool isVariable = false; 617 bool result = _TermOpe( term, baseType, resultType, isLiteral, pbUseHeap, pIsClassName, isProcedureCallOnly, isVariable, relativeVar, isWriteAccess ); 618 619 if( isVariable ) 620 { 621 // 変数の場合はeaxに変数ポインタを格納する 622 if( !VarToReg( relativeVar, baseType, resultType ) ){ 623 SetError(11,term,cp); 624 } 625 } 626 627 return result; 628 } 629 bool TermOpeOnlyVariable( const char *term, Type &resultType, RELATIVE_VAR &relativeVar, bool isWriteAccess ) 630 { 631 bool isLiteral, isVariable = false; 632 bool result = _TermOpe( term, Type(), resultType, isLiteral, NULL, NULL, false, isVariable, relativeVar, isWriteAccess ); 633 634 if( !isVariable ) 635 { 636 SetError(); 637 } 638 639 return result; 612 640 } 613 641
Note:
See TracChangeset
for help on using the changeset viewer.