Table of Contents

Class LogicalExpr

Namespace
Invex.StructuredText.Expressions
Assembly
Invex.StructuredText.dll

An AND or OR over two or more conditions. Nested nodes with the same operator are flattened.

public sealed record LogicalExpr : BoolExpr
Inheritance
object
LogicalExpr
Inherited Members

Constructors

LogicalExpr(LogicalOperator, IReadOnlyList<BoolExpr>)

An AND or OR over two or more conditions. Nested nodes with the same operator are flattened.

public LogicalExpr(LogicalOperator Operator, IReadOnlyList<BoolExpr> Operands)

Parameters

Operator LogicalOperator

The logical operator.

Operands IReadOnlyList<BoolExpr>

The operands, left to right.

Properties

Children

The direct sub-expressions of this node, in left-to-right order.

public override IEnumerable<Expr> Children { get; }

Property Value

IEnumerable<Expr>

Operands

The operands, left to right.

public IReadOnlyList<BoolExpr> Operands { get; init; }

Property Value

IReadOnlyList<BoolExpr>

Operator

The logical operator.

public LogicalOperator Operator { get; init; }

Property Value

LogicalOperator

Methods

Combine(LogicalOperator, params IEnumerable<BoolExpr>)

Combines conditions with operator, flattening operands that use the same operator.

public static BoolExpr Combine(LogicalOperator @operator, params IEnumerable<BoolExpr> operands)

Parameters

operator LogicalOperator

The logical operator.

operands IEnumerable<BoolExpr>

The operands, left to right.

Returns

BoolExpr

The single operand when only one is given, otherwise a LogicalExpr.

Exceptions

ArgumentException

Thrown when operands is empty.