source: dev/trunk/abdev/BasicCompiler_Common/Overload.cpp@ 182

Last change on this file since 182 was 182, checked in by dai_9181, 17 years ago
File size: 1.6 KB
Line 
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
9UserProc *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( !CClass::SplitName( 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}
51UserProc *OverloadSolution(
52 const char *name,
53 std::vector<UserProc *> &subs,
54 const Parameters &params,
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}
Note: See TracBrowser for help on using the repository browser.