C# Class Pchp.CodeAnalysis.Symbols.SourceRoutineSymbol

Base symbol representing a method or a function from source.
Inheritance: MethodSymbol
ファイルを表示 Open project: iolevel/peachpie Class Usage Examples

Protected Properties

Property Type Description
_params ImmutableArray

Private Properties

Property Type Description
CreateGhostOverload void
GetContextPlace IPlace
GetThisPlace IPlace
IsMetadataNewSlot bool
IsMetadataVirtual bool
SynthesizeGhostStubs void

Protected Methods

Method Description
BuildParameters ( Signature signature, PHPDocBlock phpdocOpt = null ) : IEnumerable

Builds CLR method parameters.

(Context, arg1, arg2, ...)

BuildReturnType ( Signature signature, TypeRef tref, PHPDocBlock phpdocOpt, TypeRefMask rtype ) : TypeSymbol
CreateGhostOverload ( PEModuleBuilder module, DiagnosticBag diagnostic, TypeSymbol ghostreturn, IEnumerable ghostparams, MethodSymbol explicitOverride = null ) : void

Creates ghost stub that calls current method.

CreateTypeRefContext ( ) : TypeRefContext
GenerateGhostBody ( PEModuleBuilder module, DiagnosticBag diagnostic, SynthesizedMethodSymbol ghost ) : void

Generates ghost method body that calls this method.

SynthesizeOverloadsWithOptionalParameters ( PEModuleBuilder module, DiagnosticBag diagnostic ) : void

Synthesizes method overloads in case there are optional parameters which explicit default value cannot be resolved as a ConstantValue.

foo($a = [], $b = [1, 2, 3]) + foo() => foo([], [1, 2, 3) + foo($a) => foo($a, [1, 2, 3])

Private Methods

Method Description
CreateGhostOverload ( PEModuleBuilder module, DiagnosticBag diagnostic, int pcount ) : void
GetContextPlace ( ) : IPlace

Gets place referring to Pchp.Core.Context object.

GetThisPlace ( ) : IPlace
IsMetadataNewSlot ( bool ignoreInterfaceImplementationChanges = false ) : bool

virtual = IsVirtual AND NewSlot override = IsVirtual AND !NewSlot

IsMetadataVirtual ( bool ignoreInterfaceImplementationChanges = false ) : bool
SynthesizeGhostStubs ( PEModuleBuilder module, DiagnosticBag diagnostic ) : void

Creates ghost stubs, i.e. methods with a different signature calling this routine to comply with CLR standards.

Method Details

BuildParameters() protected method

Builds CLR method parameters.
(Context, arg1, arg2, ...)
protected BuildParameters ( Signature signature, PHPDocBlock phpdocOpt = null ) : IEnumerable
signature System.Signature
phpdocOpt PHPDocBlock
return IEnumerable

BuildReturnType() protected method

protected BuildReturnType ( Signature signature, TypeRef tref, PHPDocBlock phpdocOpt, TypeRefMask rtype ) : TypeSymbol
signature System.Signature
tref TypeRef
phpdocOpt PHPDocBlock
rtype TypeRefMask
return TypeSymbol

CreateGhostOverload() protected method

Creates ghost stub that calls current method.
protected CreateGhostOverload ( PEModuleBuilder module, DiagnosticBag diagnostic, TypeSymbol ghostreturn, IEnumerable ghostparams, MethodSymbol explicitOverride = null ) : void
module PEModuleBuilder
diagnostic DiagnosticBag
ghostreturn TypeSymbol
ghostparams IEnumerable
explicitOverride MethodSymbol
return void

CreateTypeRefContext() protected abstract method

protected abstract CreateTypeRefContext ( ) : TypeRefContext
return Pchp.CodeAnalysis.FlowAnalysis.TypeRefContext

GenerateGhostBody() protected method

Generates ghost method body that calls this method.
protected GenerateGhostBody ( PEModuleBuilder module, DiagnosticBag diagnostic, SynthesizedMethodSymbol ghost ) : void
module PEModuleBuilder
diagnostic DiagnosticBag
ghost SynthesizedMethodSymbol
return void

SynthesizeOverloadsWithOptionalParameters() protected method

Synthesizes method overloads in case there are optional parameters which explicit default value cannot be resolved as a ConstantValue.
foo($a = [], $b = [1, 2, 3]) + foo() => foo([], [1, 2, 3) + foo($a) => foo($a, [1, 2, 3])
protected SynthesizeOverloadsWithOptionalParameters ( PEModuleBuilder module, DiagnosticBag diagnostic ) : void
module PEModuleBuilder
diagnostic DiagnosticBag
return void

Property Details

_params protected_oe property

protected ImmutableArray _params
return ImmutableArray