Table of Contents

Class BoolExpr

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

An expression that evaluates to a boolean.

public abstract record BoolExpr : Expr
Inheritance
object
BoolExpr
Derived
Inherited Members

Remarks

Combine conditions with &&, || and ! (or & and |). The operators build expression nodes; they never evaluate anything.

Because true and false operators are defined to support && and ||, a BoolExpr used directly as a C# condition (e.g. if (expr)) compiles but is always false.

Constructors

BoolExpr()

protected BoolExpr()

Methods

Eq(BoolExpr)

Tests this condition for equality with other.

public BoolExpr Eq(BoolExpr other)

Parameters

other BoolExpr

The value to compare with.

Returns

BoolExpr

Ne(BoolExpr)

Tests this condition for inequality with other.

public BoolExpr Ne(BoolExpr other)

Parameters

other BoolExpr

The value to compare with.

Returns

BoolExpr

Operators

operator &(BoolExpr, BoolExpr)

Combines two conditions with logical AND.

public static BoolExpr operator &(BoolExpr left, BoolExpr right)

Parameters

left BoolExpr

The left operand.

right BoolExpr

The right operand.

Returns

BoolExpr

operator |(BoolExpr, BoolExpr)

Combines two conditions with logical OR.

public static BoolExpr operator |(BoolExpr left, BoolExpr right)

Parameters

left BoolExpr

The left operand.

right BoolExpr

The right operand.

Returns

BoolExpr

operator false(BoolExpr)

Always returns false. Exists only so that || builds an OR node.

public static bool operator false(BoolExpr operand)

Parameters

operand BoolExpr

Ignored.

Returns

bool

implicit operator BoolExpr(bool)

Converts a bool to a boolean literal.

public static implicit operator BoolExpr(bool value)

Parameters

value bool

The literal value.

Returns

BoolExpr

operator !(BoolExpr)

Logically negates a condition.

public static BoolExpr operator !(BoolExpr operand)

Parameters

operand BoolExpr

The condition to negate.

Returns

BoolExpr

operator true(BoolExpr)

Always returns false. Exists only so that && builds an AND node.

public static bool operator true(BoolExpr operand)

Parameters

operand BoolExpr

Ignored.

Returns

bool