Class WhileExpression
Represents while
loop expression.
Inherited Members
Namespace: DotNext.Linq.Expressions
Assembly: DotNext.Metaprogramming.dll
Syntax
public sealed class WhileExpression : CustomExpression
Properties
| Edit this page View SourceBody
Gets body of the 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 |
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 |
Test
Gets loop condition.
Declaration
public Expression Test { get; }
Property Value
Type | Description |
---|---|
Expression |
Type
Always returns void.
Declaration
public override Type Type { get; }
Property Value
Type | Description |
---|---|
Type |
Overrides
Methods
| Edit this page View SourceCreate(Expression, Statement, bool)
Creates a new loop expression.
Declaration
public static WhileExpression Create(Expression test, WhileExpression.Statement body, bool checkConditionFirst)
Parameters
Type | Name | Description |
---|---|---|
Expression | test | The loop condition. |
WhileExpression.Statement | body | The delegate that is used to construct loop body. |
bool | checkConditionFirst | true to check condition before loop body; false to use do-while style. |
Returns
Type | Description |
---|---|
WhileExpression | The constructed loop expression. |
Create(Expression, Expression, bool)
Creates a new loop expression.
Declaration
public static WhileExpression Create(Expression test, Expression body, bool checkConditionFirst)
Parameters
Type | Name | Description |
---|---|---|
Expression | test | The loop condition. |
Expression | body | The loop body. |
bool | checkConditionFirst | true to check condition before loop body; false to use do-while style. |
Returns
Type | Description |
---|---|
WhileExpression | The constructed loop expression. |
Reduce()
Translates this expression into predefined set of expressions using Lowering technique.
Declaration
public override Expression Reduce()
Returns
Type | Description |
---|---|
Expression | Translated expression. |
Overrides
| Edit this page View SourceUpdate(Expression)
Reconstructs loop expression with a new body.
Declaration
public WhileExpression Update(Expression body)
Parameters
Type | Name | Description |
---|---|---|
Expression | body | The body of the loop. |
Returns
Type | Description |
---|---|
WhileExpression | Updated loop expression. |