source: dev/BasicCompiler_Common/Overload.cpp@ 64

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

すべてのオブジェクトを参照型に切り替えた。

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