| 1 | #include "../BasicCompiler_Common/common.h"
|
|---|
| 2 |
|
|---|
| 3 | #ifdef _AMD64_
|
|---|
| 4 | #include "../BasicCompiler64/opcode.h"
|
|---|
| 5 | #else
|
|---|
| 6 | #include "../BasicCompiler32/opcode.h"
|
|---|
| 7 | #endif
|
|---|
| 8 |
|
|---|
| 9 | UserProc *OverloadSolutionWithStrParam(
|
|---|
| 10 | const char *name,
|
|---|
| 11 | std::vector<UserProc *> &subs,
|
|---|
| 12 | const char *Parameter,
|
|---|
| 13 | const char *ObjectName){
|
|---|
| 14 |
|
|---|
| 15 | // オーバーロードの解決
|
|---|
| 16 |
|
|---|
| 17 | //オーバーロードされていないとき
|
|---|
| 18 | if( subs.size() == 1 ) return subs[0];
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 | ////////////////////////
|
|---|
| 22 | // パラメータをセット
|
|---|
| 23 | ////////////////////////
|
|---|
| 24 |
|
|---|
| 25 | ParamImpl *pobj_parameter=0;
|
|---|
| 26 |
|
|---|
| 27 | char MethodName[VN_SIZE];
|
|---|
| 28 | if( !SplitMemberName( name, NULL, MethodName ) ) lstrcpy( MethodName, name );
|
|---|
| 29 | /*
|
|---|
| 30 | //メソッドの場合は静的かどうかを調べる
|
|---|
| 31 | bool isStatic = false;
|
|---|
| 32 | CClass *pClass = subs[0]->GetParentClassPtr();
|
|---|
| 33 | if( pClass ){
|
|---|
| 34 | isStatic = pClass->IsExistStaticMethod( MethodName );
|
|---|
| 35 | }
|
|---|
| 36 | */
|
|---|
| 37 | //パラメータオブジェクトを生成
|
|---|
| 38 | pobj_parameter=new ParamImpl(Parameter);
|
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 | UserProc *pUserProc;
|
|---|
| 42 | pUserProc=pobj_parameter->OverloadSolution(name,subs);
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 | //パラメータオブジェクトを破棄
|
|---|
| 46 | delete pobj_parameter;
|
|---|
| 47 | pobj_parameter=0;
|
|---|
| 48 |
|
|---|
| 49 | return pUserProc;
|
|---|
| 50 | }
|
|---|
| 51 | UserProc *OverloadSolution(
|
|---|
| 52 | const char *name,
|
|---|
| 53 | std::vector<UserProc *> &subs,
|
|---|
| 54 | const Parameters ¶ms,
|
|---|
| 55 | const Type &returnType ){
|
|---|
| 56 |
|
|---|
| 57 | // オーバーロードの解決
|
|---|
| 58 |
|
|---|
| 59 | //オーバーロードされていないとき
|
|---|
| 60 | if( subs.size() == 1 ) return subs[0];
|
|---|
| 61 |
|
|---|
| 62 |
|
|---|
| 63 | ParamImpl *pobj_Parameter=new ParamImpl( params );
|
|---|
| 64 | if( !returnType.IsNull() ){
|
|---|
| 65 | pobj_Parameter->SetReturnType( returnType );
|
|---|
| 66 | }
|
|---|
| 67 |
|
|---|
| 68 | UserProc *pUserProc;
|
|---|
| 69 | pUserProc=pobj_Parameter->OverloadSolution(name,subs);
|
|---|
| 70 |
|
|---|
| 71 | delete pobj_Parameter;
|
|---|
| 72 |
|
|---|
| 73 | return pUserProc;
|
|---|
| 74 | }
|
|---|