C# Class IronPython.Compiler.Ast.FunctionDefinition

Inheritance: ScopeStatement
Mostra file Open project: jschementi/iron Class Usage Examples

Protected Properties

Property Type Description
_body Statement

Private Properties

Property Type Description
AddDefaultReturn System.Linq.Expressions.Expression
AddReturnTarget System.Linq.Expressions.Expression
Bind void
BindReference PythonVariable
CompileAssignment void
CreateFunctionInstructions void
CreateFunctionLambda Microsoft.Scripting.Ast.LightLambdaExpression
CreateFunctionVariables void
CreateParameters System.Linq.Expressions.ParameterExpression[]
EmitDebugFunction bool
EnsureFunctionLambda Microsoft.Scripting.Ast.LightLambdaExpression
ExposesLocalVariable bool
FinishBind void
FunctionDefinition System
FunctionDefinition System
GetDelegateType System.Type
GetLambda Microsoft.Scripting.Ast.LightLambdaExpression
GetParentClosureTuple System.Linq.Expressions.Expression
GetVarNames IList
InitializeParameters void
MakeFunctionExpression System.Linq.Expressions.Expression
RewriteBody void
TryBindOuter bool
Verify void

Public Methods

Method Description
FunctionDefinition ( string name, Parameter parameters ) : System
FunctionDefinition ( string name, Parameter parameters, Statement body ) : System
Reduce ( ) : Expression
Walk ( IronPython.Compiler.Ast.PythonWalker walker ) : void

Protected Methods

Method Description
IInstructionProvider ( LightCompiler compiler ) : void

Private Methods

Method Description
AddDefaultReturn ( System.Linq.Expressions body, Type returnType ) : Expression
AddReturnTarget ( System.Linq.Expressions expression ) : Expression
Bind ( PythonNameBinder binder ) : void
BindReference ( PythonNameBinder binder, PythonReference reference ) : PythonVariable
CompileAssignment ( LightCompiler compiler, System.Linq.Expressions variable, Action compileValue ) : void
CreateFunctionInstructions ( LightCompiler compiler ) : void
CreateFunctionLambda ( ) : Microsoft.Scripting.Ast.LightLambdaExpression

Creates the LambdaExpression which implements the body of the function. The functions signature is either "object Function(PythonFunction, ...)" where there is one object parameter for each user defined parameter or object Function(PythonFunction, object[]) for functions which take more than PythonCallTargets.MaxArgs arguments.

CreateFunctionVariables ( ReadOnlyCollectionBuilder locals, List init ) : void
CreateParameters ( bool needsWrapperMethod, ReadOnlyCollectionBuilder locals ) : System.Linq.Expressions.ParameterExpression[]
EmitDebugFunction ( ) : bool
EnsureFunctionLambda ( ) : Microsoft.Scripting.Ast.LightLambdaExpression

Creates the LambdaExpression which is the actual function body.

ExposesLocalVariable ( PythonVariable variable ) : bool
FinishBind ( PythonNameBinder binder ) : void
FunctionDefinition ( string name, Parameter parameters, SourceUnit sourceUnit ) : System
FunctionDefinition ( string name, Parameter parameters, Statement body, SourceUnit sourceUnit ) : System
GetDelegateType ( Parameter parameters, bool wrapper, Delegate &originalTarget ) : Type

Determines delegate type for the Python function

GetLambda ( ) : Microsoft.Scripting.Ast.LightLambdaExpression
GetParentClosureTuple ( ) : Expression

Pulls the closure tuple from our function/generator which is flowed into each function call.

GetVarNames ( ) : IList
InitializeParameters ( List init, bool needsWrapperMethod, System.Linq.Expressions parameters ) : void
MakeFunctionExpression ( ) : Expression

Returns an expression which creates the function object.

RewriteBody ( IronPython.Compiler.Ast.PythonAst visitor ) : void
TryBindOuter ( ScopeStatement from, PythonReference reference, PythonVariable &variable ) : bool
Verify ( PythonNameBinder binder ) : void

Method Details

FunctionDefinition() public method

public FunctionDefinition ( string name, Parameter parameters ) : System
name string
parameters Parameter
return System

FunctionDefinition() public method

public FunctionDefinition ( string name, Parameter parameters, Statement body ) : System
name string
parameters Parameter
body Statement
return System

IInstructionProvider() protected method

protected IInstructionProvider ( LightCompiler compiler ) : void
compiler LightCompiler
return void

Reduce() public method

public Reduce ( ) : Expression
return System.Linq.Expressions.Expression

Walk() public method

public Walk ( IronPython.Compiler.Ast.PythonWalker walker ) : void
walker IronPython.Compiler.Ast.PythonWalker
return void

Property Details

_body protected_oe property

protected Statement,IronPython.Compiler.Ast _body
return Statement