Class For
- Namespace
- xFunc.Maths.Expressions.Programming
- Assembly
- xFunc.Maths.dll
Represents the "for" loop.
public class For : DifferentParametersExpression, IExpression
- Inheritance
-
For
- Implements
- Inherited Members
- Extension Methods
Constructors
For(ImmutableArray<IExpression>)
Initializes a new instance of the For class.
public For(ImmutableArray<IExpression> arguments)
Parameters
argumentsImmutableArray<IExpression>The arguments.
Exceptions
- ArgumentNullException
argumentsis null.
For(IExpression, IExpression, IExpression, IExpression)
Initializes a new instance of the For class.
public For(IExpression body, IExpression init, IExpression cond, IExpression iter)
Parameters
bodyIExpressionThe body of loop.
initIExpressionThe initializer section.
condIExpressionThe condition section.
iterIExpressionThe iterator section.
Properties
Body
Gets the body of loop.
public IExpression Body { get; }
Property Value
Condition
Gets the condition section.
public IExpression Condition { get; }
Property Value
Initialization
Gets the initializer section.
public IExpression Initialization { get; }
Property Value
Iteration
Gets the iterator section.
public IExpression Iteration { get; }
Property Value
MaxParametersCount
Gets the maximum count of parameters. null - Infinity.
public override int? MaxParametersCount { get; }
Property Value
- int?
MinParametersCount
Gets the minimum count of parameters.
public override int? MinParametersCount { get; }
Property Value
- int?
Methods
AnalyzeInternal<TResult>(IAnalyzer<TResult>)
Analyzes the current expression.
protected override TResult AnalyzeInternal<TResult>(IAnalyzer<TResult> analyzer)
Parameters
analyzerIAnalyzer<TResult>The analyzer.
Returns
- TResult
The analysis result.
Type Parameters
TResultThe type of the result.
AnalyzeInternal<TResult, TContext>(IAnalyzer<TResult, TContext>, TContext)
Analyzes the current expression.
[ExcludeFromCodeCoverage]
protected override TResult AnalyzeInternal<TResult, TContext>(IAnalyzer<TResult, TContext> analyzer, TContext context)
Parameters
analyzerIAnalyzer<TResult, TContext>The analyzer.
contextTContextThe context.
Returns
- TResult
The analysis result.
Type Parameters
TResultThe type of the result.
TContextThe type of additional parameter for analyzer.
Clone(ImmutableArray<IExpression>?)
Clones this instance of the IExpression.
public override IExpression Clone(ImmutableArray<IExpression>? arguments = null)
Parameters
argumentsImmutableArray<IExpression>?The list of arguments.
Returns
- IExpression
Returns the new instance of IExpression that is a clone of this instance.
Execute(ExpressionParameters?)
Executes this expression.
public override object Execute(ExpressionParameters? parameters)
Parameters
parametersExpressionParametersAn object that contains all parameters and functions for expressions.
Returns
- object
A result of the execution.
Exceptions
- ExecutionException
The result of evaluation of arguments is not supported.
- See Also