Changeset 206 in dev for trunk/abdev/BasicCompiler_Common/NumOpe_GetType.cpp
- Timestamp:
- Jul 12, 2007, 2:58:26 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/NumOpe_GetType.cpp
r198 r206 1 #include "stdafx.h" 2 1 3 #include <jenga/include/smoothie/Smoothie.h> 2 4 #include <jenga/include/smoothie/LexicalAnalysis.h> … … 198 200 pobj_c=(CClass *)index_stack[sp-2]; 199 201 200 std::vector< UserProc *> subs;202 std::vector<const UserProc *> subs; 201 203 pobj_c->GetMethods().Enum( idCalc, subs ); 202 204 if( subs.size() == 0 ){ … … 228 230 if(idCalc==CALC_EQUAL) lstrcpy(temporary,"=="); 229 231 else GetCalcName(idCalc,temporary); 230 UserProc *pUserProc = OverloadSolution( temporary, subs, params, baseType );232 const UserProc *pUserProc = OverloadSolution( temporary, subs, params, baseType ); 231 233 232 234 if(bTwoTerm){ … … 315 317 // パース 316 318 char member[VN_SIZE]; 317 CClass::RefTyperefType;318 if( CClass::SplitName( termFull, termLeft, member, refType ) ){319 ReferenceKind refType; 320 if( SplitMemberName( termFull, termLeft, member, refType ) ){ 319 321 /////////////////////////////////////////////////////////////////// 320 322 // オブジェクトとメンバに分解できるとき … … 371 373 // 動的メソッドを検索 372 374 /////////////////////////////////////////////////////////////////// 373 vector<UserProc *> userProcs;374 375 375 char methodName[VN_SIZE] ,lpPtrOffset[VN_SIZE]; 376 376 lstrcpy( methodName, member ); 377 377 GetVarFormatString(methodName,parameter,lpPtrOffset,member,refType); 378 378 379 vector<const UserProc *> userProcs; 379 380 objClass.GetMethods().Enum( methodName, userProcs ); 380 UserProc *pUserProc;381 381 if(userProcs.size()){ 382 382 //オーバーロードを解決 383 pUserProc=OverloadSolutionWithStrParam(termFull,userProcs,parameter,termLeft);383 const UserProc *pUserProc = OverloadSolutionWithStrParam(termFull,userProcs,parameter,termLeft); 384 384 385 385 if( pUserProc ){ … … 413 413 if(lstrcmpi(termFull,"This")==0){ 414 414 //Thisオブジェクト 415 resultType.SetType( DEF_OBJECT, Smoothie::Temp::pCompilingClass );415 resultType.SetType( DEF_OBJECT, compiler.pCompilingClass ); 416 416 isLiteral = false; 417 417 return true; … … 455 455 return true; 456 456 } 457 else if(GetConstCalcBuffer(procName,parameter,temporary)){ 458 ///////////////////////// 459 // マクロ関数 460 ///////////////////////// 461 462 //閉じカッコ")"に続く文字がNULLでないときはエラーにする 463 if(termFull[i2+1+i4+1]!='\0') SetError(42,NULL,cp); 464 465 //マクロ関数の場合 466 if( !NumOpe_GetType(temporary,Type(),resultType) ){ 467 return false; 468 } 469 470 if( !IS_LITERAL( resultType.GetIndex() ) ){ 471 //リテラル値ではなかったとき 472 isLiteral = false; 473 } 474 475 return true; 457 else 458 { 459 ConstMacro *pConstMacro = compiler.GetMeta().GetGlobalConstMacros().Find( procName ); 460 if( pConstMacro ) 461 { 462 if( pConstMacro->GetCalcBuffer( parameter, temporary ) ) 463 { 464 ///////////////////////// 465 // マクロ関数 466 ///////////////////////// 467 468 //閉じカッコ")"に続く文字がNULLでないときはエラーにする 469 if(termFull[i2+1+i4+1]!='\0') SetError(42,NULL,cp); 470 471 //マクロ関数の場合 472 if( !NumOpe_GetType(temporary,Type(),resultType) ){ 473 return false; 474 } 475 476 if( !IS_LITERAL( resultType.GetIndex() ) ){ 477 //リテラル値ではなかったとき 478 isLiteral = false; 479 } 480 481 return true; 482 } 483 } 476 484 } 477 485 } … … 732 740 ////////////// 733 741 734 i3 = CDBConst::obj.GetBasicType(term);742 i3 = compiler.GetMeta().GetGlobalConsts().GetBasicType(term); 735 743 if(i3){ 736 if( CDBConst::obj.IsStringPtr( term ) ){744 if( compiler.GetMeta().GetGlobalConsts().IsStringPtr( term ) ){ 737 745 //リテラル文字列 738 746 goto StrLiteral;
Note:
See TracChangeset
for help on using the changeset viewer.