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

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

コード全体のリファクタリングを実施

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