source: dev/BasicCompiler_Common/Overload.cpp@ 74

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

Parameterクラスを適用。32bit側は動くようになったので、64bitのほうを調整する。

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 if(lstrcmp(Parameter,"\"test\"")==0){
40 int i=0;
41 }
42 pobj_parameter=new ParamImpl(Parameter);
43 if(pReturnTypeInfo) pobj_parameter->SetReturnType(pReturnTypeInfo);
44
45
46 SubInfo *psi;
47 psi=pobj_parameter->OverloadSolution(name,subs);
48
49
50 //パラメータオブジェクトを破棄
51 delete pobj_parameter;
52 pobj_parameter=0;
53
54 return psi;
55}
56
57SubInfo *OverloadSolution(
58 const char *name,
59 std::vector<SubInfo *> &subs,
60 const PARAMETER_INFO *ppi,
61 const int ParmNum,
62 TYPEINFO *pReturnTypeInfo){
63
64 // オーバーロードの解決
65
66 //オーバーロードされていないとき
67 if( subs.size() == 1 ) return subs[0];
68
69
70 ParamImpl *pobj_Parameter=new ParamImpl(ppi,ParmNum);
71 if(pReturnTypeInfo) pobj_Parameter->SetReturnType(pReturnTypeInfo);
72
73 SubInfo *psi;
74 psi=pobj_Parameter->OverloadSolution(name,subs);
75
76 delete pobj_Parameter;
77
78 return psi;
79}
Note: See TracBrowser for help on using the repository browser.