Structure
AQLBinaryExpression
Represents binary operations in AQL (arithmetic, comparison, logical).
struct AQLBinaryExpression
Overview
Binary expressions combine two operands with an operator to produce a result. Operators follow standard mathematical and logical semantics.
Supported Operators
Arithmetic
-
+(add),-(subtract),*(multiply),/(divide),mod(modulo)
Comparison
-
=(equals),<>(notEquals) -
<(lessThan),>(greaterThan),<=(lessOrEqual),>=(greaterOrEqual)
Logical
-
and,or,implies,xor
String
-
+(concat) - String concatenation
Example Usage
// Arithmetic: age + 10
let addExpr = AQLBinaryExpression(
left: ageExpr,
op: .add,
right: AQLLiteralExpression(value: 10)
)
// Comparison: age > 18
let comparisonExpr = AQLBinaryExpression(
left: ageExpr,
op: .greaterThan,
right: AQLLiteralExpression(value: 18)
)
// Logical: isActive and isPublic
let logicalExpr = AQLBinaryExpression(
left: isActiveExpr,
op: .and,
right: isPublicExpr
)
Topics
Initializers
?
init(left:op:right:)
Creates a binary expression.
Instance Properties
V
left
The left operand expression.
V
op
The operator to apply.
V
right
The right operand expression.
Instance Methods
F
evaluate(in:)
Evaluates the expression within the specified execution context.
Enumerations
E
AQLBinaryExpression.Operator
Binary operator type.