Table of Contents

Class ComparisonInfixOperation

Namespace
Albatross.Expression.Infix
Assembly
Albatross.Expression.dll

Base class for infix operations that perform comparison between two operands of the same type.

public abstract class ComparisonInfixOperation : InfixExpression, IInfixExpression, IExpression, IToken, IHasPrecedence
Inheritance
ComparisonInfixOperation
Implements
Derived
Inherited Members
Extension Methods

Constructors

ComparisonInfixOperation(string, int)

Initializes a new instance of the ComparisonInfixOperation class.

protected ComparisonInfixOperation(string operatorSymbol, int precedence)

Parameters

operatorSymbol string

The operator symbol for this comparison.

precedence int

The precedence level for this operation.

Methods

Interpret(int)

Interprets the result of the comparison operation.

public abstract bool Interpret(int comparisonResult)

Parameters

comparisonResult int

The result from the comparison (-1, 0, or 1).

Returns

bool

True if the comparison satisfies the operation's condition; otherwise, false.

Run(object, object)

Executes the infix operation with the evaluated left and right operands. Derived classes should override this method to implement specific operations.

protected override object Run(object left, object right)

Parameters

left object

The evaluated left operand value.

right object

The evaluated right operand value.

Returns

object

The result of the operation.