C# Class Microsoft.Scripting.Actions.Calls.KeywordArgBuilder

ArgBuilder which provides a value for a keyword argument. The KeywordArgBuilder calculates its position at emit time using it's initial offset within the keyword arguments, the number of keyword arguments, and the total number of arguments provided by the user. It then delegates to an underlying ArgBuilder which only receives the single correct argument. Delaying the calculation of the position to emit time allows the method binding to be done without knowing the exact the number of arguments provided by the user. Hence, the method binder can be dependent only on the set of method overloads and keyword names, but not the user arguments. While the number of user arguments could be determined upfront, the current MethodBinder does not have this design.
Inheritance: ArgBuilder
Exibir arquivo Open project: jschementi/iron Class Usage Examples

Private Properties

Property Type Description
BuilderExpectsSingleParameter bool
GetKeywordIndex int
MakeRestrictedArg Microsoft.Scripting.Actions.Calls.RestrictedArguments
ToReturnExpression System.Linq.Expressions.Expression
UpdateFromReturn System.Linq.Expressions.Expression

Public Methods

Method Description
Clone ( ParameterInfo newType ) : ArgBuilder
KeywordArgBuilder ( ArgBuilder builder, int kwArgCount, int kwArgIndex ) : System.Linq.Expressions

Protected Methods

Method Description
ToExpression ( OverloadResolver resolver, Microsoft.Scripting.Actions.Calls.RestrictedArguments args, bool hasBeenUsed ) : Expression

Private Methods

Method Description
BuilderExpectsSingleParameter ( ArgBuilder builder ) : bool

The underlying builder should expect a single parameter as KeywordArgBuilder is responsible for calculating the correct parameter to use

GetKeywordIndex ( int paramCount ) : int
MakeRestrictedArg ( Microsoft.Scripting.Actions.Calls.RestrictedArguments args, int index ) : Microsoft.Scripting.Actions.Calls.RestrictedArguments
ToReturnExpression ( OverloadResolver resolver ) : Expression
UpdateFromReturn ( OverloadResolver resolver, Microsoft.Scripting.Actions.Calls.RestrictedArguments args ) : Expression

Method Details

Clone() public method

public Clone ( ParameterInfo newType ) : ArgBuilder
newType ParameterInfo
return ArgBuilder

KeywordArgBuilder() public method

public KeywordArgBuilder ( ArgBuilder builder, int kwArgCount, int kwArgIndex ) : System.Linq.Expressions
builder ArgBuilder
kwArgCount int
kwArgIndex int
return System.Linq.Expressions

ToExpression() protected method

protected ToExpression ( OverloadResolver resolver, Microsoft.Scripting.Actions.Calls.RestrictedArguments args, bool hasBeenUsed ) : Expression
resolver OverloadResolver
args Microsoft.Scripting.Actions.Calls.RestrictedArguments
hasBeenUsed bool
return System.Linq.Expressions.Expression