Table of Contents

Class BinaryExpression

Namespace
xFunc.Maths.Expressions
Assembly
xFunc.Maths.dll

The base class for binary operations.

public abstract class BinaryExpression : IExpression
Inheritance
BinaryExpression
Implements
Derived
Inherited Members
Extension Methods

Constructors

BinaryExpression(ImmutableArray<IExpression>)

Initializes a new instance of the BinaryExpression class.

protected BinaryExpression(ImmutableArray<IExpression> arguments)

Parameters

arguments ImmutableArray<IExpression>

The list of arguments.

Exceptions

ArgumentNullException

arguments is null.

ParseException

The arguments collection should have only two arguments.

BinaryExpression(IExpression, IExpression)

Initializes a new instance of the BinaryExpression class.

protected BinaryExpression(IExpression left, IExpression right)

Parameters

left IExpression

The left (first) operand.

right IExpression

The right (second) operand.

Exceptions

ArgumentNullException

left or right is null.

Properties

Left

Gets the left (first) operand.

public IExpression Left { get; }

Property Value

IExpression

Right

Gets the right (second) operand.

public IExpression Right { get; }

Property Value

IExpression

Methods

AnalyzeInternal<TResult>(IAnalyzer<TResult>)

Analyzes the current expression.

protected abstract TResult AnalyzeInternal<TResult>(IAnalyzer<TResult> analyzer)

Parameters

analyzer IAnalyzer<TResult>

The analyzer.

Returns

TResult

The analysis result.

Type Parameters

TResult

The type of the result.

AnalyzeInternal<TResult, TContext>(IAnalyzer<TResult, TContext>, TContext)

Analyzes the current expression.

protected abstract TResult AnalyzeInternal<TResult, TContext>(IAnalyzer<TResult, TContext> analyzer, TContext context)

Parameters

analyzer IAnalyzer<TResult, TContext>

The analyzer.

context TContext

The context.

Returns

TResult

The analysis result.

Type Parameters

TResult

The type of the result.

TContext

The type of additional parameter for analyzer.

Analyze<TResult>(IAnalyzer<TResult>)

Analyzes the current expression.

public TResult Analyze<TResult>(IAnalyzer<TResult> analyzer)

Parameters

analyzer IAnalyzer<TResult>

The analyzer.

Returns

TResult

The analysis result.

Type Parameters

TResult

The type of the result.

Exceptions

ArgumentNullException

analyzer is null.

Analyze<TResult, TContext>(IAnalyzer<TResult, TContext>, TContext)

Analyzes the current expression.

public TResult Analyze<TResult, TContext>(IAnalyzer<TResult, TContext> analyzer, TContext context)

Parameters

analyzer IAnalyzer<TResult, TContext>

The analyzer.

context TContext

The context.

Returns

TResult

The analysis result.

Type Parameters

TResult

The type of the result.

TContext

The type of additional parameter for analyzer.

Exceptions

ArgumentNullException

analyzer is null.

Clone(IExpression?, IExpression?)

Clones this instance of the IExpression.

public abstract IExpression Clone(IExpression? left = null, IExpression? right = null)

Parameters

left IExpression

The left argument of new expression.

right IExpression

The right argument of new expression.

Returns

IExpression

Returns the new instance of IExpression that is a clone of this instance.

Deconstruct(out IExpression, out IExpression)

Deconstructs BinaryExpression.

public void Deconstruct(out IExpression left, out IExpression right)

Parameters

left IExpression

The left operand.

right IExpression

The right operand.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

Execute()

Executes this expression. Don't use this method if your expression has variables or user-functions.

public object Execute()

Returns

object

A result of the execution.

Exceptions

ExecutionException

The result of Left or Right operand evaluation is not supported by this expression.

Execute(ExpressionParameters?)

Executes this expression.

public abstract object Execute(ExpressionParameters? parameters)

Parameters

parameters ExpressionParameters

An object that contains all parameters and functions for expressions.

Returns

object

A result of the execution.

Exceptions

ExecutionException

The result of Left or Right operand evaluation is not supported by this expression.

See Also

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

ToString(IFormatter)

Returns a string that represents this instance.

public string ToString(IFormatter formatter)

Parameters

formatter IFormatter

The formatter.

Returns

string

A string that represents this instance.