source: dev/BasicCompiler_Common/Overload.cpp@ 71

Last change on this file since 71 was 71, checked in by dai_9181, 17 years ago

Parameter.cpp→ParamImpl.cpp
CParameter→ParamImpl

Type.cpp、Type.hを用意した。

File size: 1.7 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
9SUBINFO *OverloadSolutionWithStrParam(
10 const char *name,
11 std::vector<SUBINFO *> &subs,
12 const char *Parameter,
13 const char *ObjectName,
14 TYPEINFO *pReturnTypeInfo){
15
16 // オーバーロードの解決
17
18 //オーバーロードされていないとき
19 if( subs.size() == 1 ) return subs[0];
20
21
22 ////////////////////////
23 // パラメータをセット
24 ////////////////////////
25
26 ParamImpl *pobj_parameter=0;
27
28 char MethodName[VN_SIZE];
29 if( !SplitMemberName( name, NULL, MethodName ) ) lstrcpy( MethodName, name );
30/*
31 //メソッドの場合は静的かどうかを調べる
32 bool isStatic = false;
33 CClass *pClass = subs[0]->pobj_ParentClass;
34 if( pClass ){
35 isStatic = pClass->IsExistStaticMethod( MethodName );
36 }
37*/
38 //パラメータオブジェクトを生成
39 pobj_parameter=new ParamImpl(Parameter);
40 if(pReturnTypeInfo) pobj_parameter->SetReturnType(pReturnTypeInfo);
41
42
43 SUBINFO *psi;
44 psi=pobj_parameter->OverloadSolution(name,subs);
45
46
47 //パラメータオブジェクトを破棄
48 delete pobj_parameter;
49 pobj_parameter=0;
50
51 return psi;
52}
53
54SUBINFO *OverloadSolution(
55 const char *name,
56 std::vector<SUBINFO *> &subs,
57 const PARAMETER_INFO *ppi,
58 const int ParmNum,
59 TYPEINFO *pReturnTypeInfo){
60
61 // オーバーロードの解決
62
63 //オーバーロードされていないとき
64 if( subs.size() == 1 ) return subs[0];
65
66
67 ParamImpl *pobj_Parameter=new ParamImpl(ppi,ParmNum);
68 if(pReturnTypeInfo) pobj_Parameter->SetReturnType(pReturnTypeInfo);
69
70 SUBINFO *psi;
71 psi=pobj_Parameter->OverloadSolution(name,subs);
72
73 delete pobj_Parameter;
74
75 return psi;
76}
Note: See TracBrowser for help on using the repository browser.