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
-
objectLogicalExpr
- 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
OperatorLogicalOperatorThe logical operator.
OperandsIReadOnlyList<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
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
operatorLogicalOperatorThe logical operator.
operandsIEnumerable<BoolExpr>The operands, left to right.
Returns
- BoolExpr
The single operand when only one is given, otherwise a LogicalExpr.
Exceptions
- ArgumentException
Thrown when
operandsis empty.