Class ForExpression
Represents for
loop as expression.
Namespace: DotNext.Linq.Expressions
Assembly: DotNext.Metaprogramming.dll
Syntax
public sealed class ForExpression : Expression, ILoopLabels
Properties
| Improve this Doc View SourceBody
Gets body of this loop.
Declaration
public Expression Body { get; }
Property Value
Type | Description |
---|---|
Expression |
BreakLabel
Gets label that is used by the loop body as a break statement target.
Declaration
public LabelTarget BreakLabel { get; }
Property Value
Type | Description |
---|---|
LabelTarget |
CanReduce
Always returns true because
this expression is
Declaration
public override bool CanReduce { get; }
Property Value
Type | Description |
---|---|
Boolean |
ContinueLabel
Gets label that is used by the loop body as a continue statement target.
Declaration
public LabelTarget ContinueLabel { get; }
Property Value
Type | Description |
---|---|
LabelTarget |
Initialization
Represents loop variable initialization expression.
Declaration
public Expression Initialization { get; }
Property Value
Type | Description |
---|---|
Expression |
LoopVar
Represents loop variable initialized by Initialization.
Declaration
public ParameterExpression LoopVar { get; }
Property Value
Type | Description |
---|---|
ParameterExpression |
NodeType
Always returns
Declaration
public override ExpressionType NodeType { get; }
Property Value
Type | Description |
---|---|
ExpressionType |
Test
Represents condition of the loop continuation.
Declaration
public Expression Test { get; }
Property Value
Type | Description |
---|---|
Expression |
Type
Always returns
Declaration
public override Type Type { get; }
Property Value
Type | Description |
---|---|
Type |
Methods
| Improve this Doc View SourceBuilder(Expression)
Creates a builder of ForExpression.
Declaration
public static ForExpression.LoopBuilder Builder(Expression initialization)
Parameters
Type | Name | Description |
---|---|---|
Expression | initialization | Loop variable initialization expression. |
Returns
Type | Description |
---|---|
ForExpression.LoopBuilder | A new instance of builder. |
Reduce()
Translates this expression into predefined set of expressions using Lowering technique.
Declaration
public override Expression Reduce()
Returns
Type | Description |
---|---|
Expression | Translated expression. |