source: dev/trunk/ab5.0/abdev/BasicCompiler_Common/src/Delegate.cpp@ 576

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

ParseDllProc/SetParamsAndReturnTypeForUserProcを実装。

File size: 1.2 KB
Line 
1#include "stdafx.h"
2
3#include <Delegate.h>
4
5void Delegate::RefleshParameterAndReturnType()
6{
7 compiler.GetNamespaceSupporter().SetImportedNamespaces( this->importedNamespaces );
8 compiler.GetNamespaceSupporter().SetLivingNamespaceScopes( this->GetNamespaceScopes() );
9
10 // パラメータを解析
11 Jenga::Common::Strings parameterStrings;
12 SplitParameter( paramStr, parameterStrings );
13 ActiveBasic::Compiler::LexicalAnalyzer::AnalyzeParameter( this->GetParameters(), parameterStrings, sourceIndex );
14
15 // 動的パラメータを作る
16 dynamicParams = this->GetParameters();
17 dynamicParams.insert( dynamicParams.begin(), new Parameter( "_System_LocalThis", Type( DEF_PTR_VOID ) ) );
18
19 if( IsFunction() )
20 {
21 // 戻り値を取得
22 if( !compiler.StringToType( returnTypeName, returnType ) )
23 {
24 compiler.errorMessenger.Output(3,returnTypeName,sourceIndex);
25 }
26 }
27}
28
29bool Delegate::IsSimilar( const Delegate &dgt ) const
30{
31 if( this->Params().Equals( dgt.Params(), true ) ) // パラメータが等しい、もしくは反変
32 {
33 if( this->returnType.Equals( dgt.returnType ) )
34 {
35 // 戻り値が等しい
36 return true;
37 }
38 else if( this->returnType.IsCovariant( dgt.returnType ) )
39 {
40 // 戻り値が共変
41 return true;
42 }
43 }
44 return false;
45}
Note: See TracBrowser for help on using the repository browser.