Last change
on this file since 530 was 525, checked in by dai_9181, 16 years ago |
デリゲート収集コードの実装をLexicalAnalyzerクラスに移動した。
|
File size:
1.1 KB
|
Rev | Line | |
---|
[322] | 1 | #include "stdafx.h"
|
---|
| 2 |
|
---|
| 3 | #include <Delegate.h>
|
---|
| 4 |
|
---|
[422] | 5 | void Delegate::RefleshParameterAndReturnType()
|
---|
[322] | 6 | {
|
---|
[449] | 7 | compiler.GetNamespaceSupporter().SetImportedNamespaces( this->importedNamespaces );
|
---|
| 8 | compiler.GetNamespaceSupporter().SetLivingNamespaceScopes( this->GetNamespaceScopes() );
|
---|
| 9 |
|
---|
[422] | 10 | // パラメータを解析
|
---|
| 11 | params.Analyze( paramStr.c_str(), sourceIndex );
|
---|
[339] | 12 |
|
---|
[422] | 13 | // 動的パラメータを作る
|
---|
[339] | 14 | dynamicParams = params;
|
---|
| 15 | dynamicParams.insert( dynamicParams.begin(), new Parameter( "_System_LocalThis", Type( DEF_PTR_VOID ) ) );
|
---|
[422] | 16 |
|
---|
| 17 | if( IsFunction() )
|
---|
| 18 | {
|
---|
| 19 | // 戻り値を取得
|
---|
| 20 | if( !compiler.StringToType( returnTypeName, returnType ) )
|
---|
| 21 | {
|
---|
[465] | 22 | compiler.errorMessenger.Output(3,returnTypeName,sourceIndex);
|
---|
[422] | 23 | }
|
---|
| 24 | }
|
---|
[322] | 25 | }
|
---|
| 26 |
|
---|
[448] | 27 | bool Delegate::IsSimilar( const Delegate &dgt ) const
|
---|
| 28 | {
|
---|
| 29 | if( this->Params().Equals( dgt.Params(), true ) ) // パラメータが等しい、もしくは反変
|
---|
| 30 | {
|
---|
| 31 | if( this->returnType.Equals( dgt.returnType ) )
|
---|
| 32 | {
|
---|
| 33 | // 戻り値が等しい
|
---|
| 34 | return true;
|
---|
| 35 | }
|
---|
| 36 | else if( this->returnType.IsCovariant( dgt.returnType ) )
|
---|
| 37 | {
|
---|
| 38 | // 戻り値が共変
|
---|
| 39 | return true;
|
---|
| 40 | }
|
---|
| 41 | }
|
---|
| 42 | return false;
|
---|
| 43 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.