source: dev/BasicCompiler_Common/Overload.cpp@ 73

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

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

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