Class BoolExpr
- Namespace
- Invex.StructuredText.Expressions
- Assembly
- Invex.StructuredText.dll
An expression that evaluates to a boolean.
public abstract record BoolExpr : Expr
- Inheritance
-
objectBoolExpr
- 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
otherBoolExprThe value to compare with.
Returns
Ne(BoolExpr)
Tests this condition for inequality with other.
public BoolExpr Ne(BoolExpr other)
Parameters
otherBoolExprThe value to compare with.
Returns
Operators
operator &(BoolExpr, BoolExpr)
Combines two conditions with logical AND.
public static BoolExpr operator &(BoolExpr left, BoolExpr right)
Parameters
Returns
operator |(BoolExpr, BoolExpr)
Combines two conditions with logical OR.
public static BoolExpr operator |(BoolExpr left, BoolExpr right)
Parameters
Returns
operator false(BoolExpr)
Always returns false. Exists only so that || builds an OR node.
public static bool operator false(BoolExpr operand)
Parameters
operandBoolExprIgnored.
Returns
- bool
implicit operator BoolExpr(bool)
Converts a bool to a boolean literal.
public static implicit operator BoolExpr(bool value)
Parameters
valueboolThe literal value.
Returns
operator !(BoolExpr)
Logically negates a condition.
public static BoolExpr operator !(BoolExpr operand)
Parameters
operandBoolExprThe condition to negate.
Returns
operator true(BoolExpr)
Always returns false. Exists only so that && builds an AND node.
public static bool operator true(BoolExpr operand)
Parameters
operandBoolExprIgnored.
Returns
- bool