Skip to content

Operators and precedence

Operators combine operands (variables, literals, function calls) into expressions. This page lists the operators logiccloud supports and the exact precedence and associativity used by the parser.

OperatorMeaning
:=Assignment. Assigns the value of an expression to a variable.
?=Reference assignment attempt. Assigns a reference only if the runtime types are compatible, otherwise leaves the target NULL. See references.

Assignment is a statement, not an expression operator — it cannot appear inside a larger expression.

OperatorMeaning
**Exponentiation (power)
*Multiplication
/Division
MODModulo (integer remainder)
+Addition (binary) / unary plus
-Subtraction (binary) / unary negation

All comparison operators sit at the same precedence level and produce a BOOL result.

OperatorMeaning
=Equal
<>Not equal
<Less than
>Greater than
<=Less than or equal
>=Greater than or equal

These operate bit-by-bit on bit-string types and logically on BOOL. In the grammar & and AND are the same operator, and AND, &, OR and XOR all share a single precedence level.

OperatorMeaning
AND, &Logical / bitwise AND
ORLogical / bitwise OR
XORLogical / bitwise exclusive OR
NOTLogical / bitwise negation (unary)
enabled := running AND NOT faulted;
mask := flagsA & flagsB; // & is AND

From highest to lowest precedence. Within a precedence level the binary operators are left-associative (evaluated left to right); parentheses override precedence entirely.

PrecedenceOperatorsNotes
Highest()Parenthesized sub-expression
Func(args)Function / method call
**Exponentiation
unary +, -, NOTApplied to a single operand
*, /, MOD
+, - (binary)
=, <>, <, >, <=, >=All comparisons at one level
LowestAND / &, OR, XORAll bitwise/boolean ops at one level