Changeset 700 in dev for trunk/ab5.0/abdev/compiler_x86/NumOpe.cpp
- Timestamp:
- Jul 21, 2008, 1:04:12 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/compiler_x86/NumOpe.cpp
r676 r700 353 353 bool _TermOpe( const char *term, const Type &baseType, Type &resultType, bool &isLiteral, bool &isNeedHeapFreeStructure, bool *pIsClassName, bool isProcedureCallOnly, bool &isVariable, RELATIVE_VAR &relativeVar, bool isWriteAccess ) 354 354 { 355 extern void GetWithName(std::string&); 356 355 357 char parameter[VN_SIZE]; 356 357 358 // Withを解決 358 char termFull[VN_SIZE];359 std::string termFull; 359 360 if(term[0]=='.'){ 360 361 GetWithName(termFull); 361 lstrcat(termFull,term);362 } 363 else lstrcpy(termFull,term);364 365 char termLeft[VN_SIZE];366 lstrcpy(termLeft,termFull);362 termFull.insert(termFull.end(),term,term+strlen(term)); 363 } 364 else termFull.assign(term,term+strlen(term)); 365 366 std::vector<char> termLeft(termFull.begin(), termFull.end()); 367 termLeft.push_back('\0'); 367 368 368 369 // パース 369 370 char member[VN_SIZE]; 370 371 ReferenceKind refType; 371 if( SplitMemberName( termFull , termLeft, member, refType ) ){372 if( SplitMemberName( termFull.c_str(), &termLeft[0], member, refType ) ){ 372 373 /////////////////////////////////////////////////////////////////// 373 374 // オブジェクトとメンバに分解できるとき … … 380 381 bool isClassName = false; 381 382 Type leftType; 382 if( GetTermType( termLeft, Type(), leftType, isLiteral, &isClassName ) ){383 if( GetTermType( &termLeft[0], Type(), leftType, isLiteral, &isClassName ) ){ 383 384 if( isClassName == false && compiler.GetObjectModule().meta.GetBlittableTypes().IsExist( leftType ) ){ 384 385 // 左側のオブジェクト部分がBlittable型のとき 385 386 /* 386 387 char temporary[VN_SIZE]; 387 388 lstrcpy( temporary, termLeft ); … … 389 390 compiler.GetObjectModule().meta.GetBlittableTypes().Find( leftType ).GetCreateStaticMethodFullName().c_str(), 390 391 temporary ); 391 } 392 } 393 394 if( !TermOpe( termLeft, baseType, leftType, isLiteral, isNeedHeapFreeStructure, &isClassName ) ){ 392 */ 393 std::vector<char> temporary; 394 const std::string& staticMethodFullName = compiler.GetObjectModule().meta.GetBlittableTypes().Find( leftType ).GetCreateStaticMethodFullName(); 395 temporary.reserve(VN_SIZE); 396 temporary.assign(staticMethodFullName.begin(), staticMethodFullName.end()); 397 temporary.push_back('('); 398 temporary.insert(temporary.end(), termLeft.begin(), termLeft.end()); 399 temporary.push_back(')'); 400 temporary.swap(termLeft); 401 } 402 } 403 404 if( !TermOpe( &termLeft[0], baseType, leftType, isLiteral, isNeedHeapFreeStructure, &isClassName ) ){ 395 405 goto globalArea; 396 406 } … … 410 420 } 411 421 412 return TermMemberOpe( leftType, isNeedHeapFreeStructure, baseType, resultType, termFull , termLeft, member, isVariable, relativeVar );422 return TermMemberOpe( leftType, isNeedHeapFreeStructure, baseType, resultType, termFull.c_str(), &termLeft[0], member, isVariable, relativeVar ); 413 423 } 414 424 globalArea: … … 420 430 421 431 if( pIsClassName ){ 422 if( compiler.GetObjectModule().meta.FindClassSupportedTypeDef( LexicalAnalyzer::FullNameToSymbol( termFull ) ) ){432 if( compiler.GetObjectModule().meta.FindClassSupportedTypeDef( LexicalAnalyzer::FullNameToSymbol( termFull.c_str() ) ) ){ 423 433 *pIsClassName = true; 424 434 return true; … … 434 444 435 445 436 if(lstrcmpi(termFull ,"This")==0 && isProcedureCallOnly == false ){446 if(lstrcmpi(termFull.c_str(),"This")==0 && isProcedureCallOnly == false ){ 437 447 if( !compiler.IsCompilingClass() ) 438 448 { … … 458 468 char temporary[8192]; 459 469 460 int i2=GetCallProcName(termFull ,procName);470 int i2=GetCallProcName(termFull.c_str(),procName); 461 471 if(termFull[i2]=='('){ 462 int i4=GetStringInPare_RemovePare(parameter,termFull +i2+1);472 int i4=GetStringInPare_RemovePare(parameter,termFull.c_str()+i2+1); 463 473 464 474 void *pInfo; … … 557 567 558 568 char VarName[VN_SIZE],ArrayElements[VN_SIZE]; 559 GetArrayElement(termFull ,VarName,ArrayElements);569 GetArrayElement(termFull.c_str(),VarName,ArrayElements); 560 570 if(ArrayElements[0]){ 561 571 Type classType; … … 579 589 false, //エラー表示なし 580 590 isWriteAccess, 581 termFull ,591 termFull.c_str(), 582 592 &relativeVar,resultType)){ 583 593 ////////// … … 599 609 600 610 //配列要素を排除 601 GetArrayElement(termFull ,VarName,ArrayElements);611 GetArrayElement(termFull.c_str(),VarName,ArrayElements); 602 612 603 613 if(GetSubHash(VarName,0)){ 604 614 605 615 { 606 CallPropertyMethod(termFull ,NULL,resultType);616 CallPropertyMethod(termFull.c_str(),NULL,resultType); 607 617 608 618 //大きな型への暗黙の変換 … … 636 646 if( isProcedureCallOnly ) 637 647 { 638 compiler.errorMessenger.Output(3, termFull , cp );648 compiler.errorMessenger.Output(3, termFull.c_str(), cp ); 639 649 } 640 650
Note:
See TracChangeset
for help on using the changeset viewer.