Operator precedence
When an expression contains several operators, precedence decides which operators apply first. The table lists the operators from the highest precedence to the lowest. Operators on the same level have the same precedence, and the last column shows how EFX groups several of them in a row. Parentheses change the order that precedence sets (see Parentheses and precedence).
Precedence table
| Level | Operators | Grouping |
|---|---|---|
1 |
parentheses |
from left to right |
2 |
|
from left to right |
3 |
|
from left to right |
4 |
the conditions, each applying before the ones listed after it: |
from left to right |
5 |
|
from left to right |
6 |
|
from left to right |
7 |
|
from left to right |
8 |
|
the last part extends as far to the right as possible |
Some consequences of the table:
-
1 + 2 * 3is1 + (2 * 3), and10 - 2 - 3is(10 - 2) - 3. -
BT-00-Number + 1 in [2, 3]is(BT-00-Number + 1) in [2, 3]. -
BT-00-Indicator == BT-00-Text in ['a', 'b']isBT-00-Indicator == (BT-00-Text in ['a', 'b']): a condition applies before a comparison. -
1 < 2 == TRUEis(1 < 2) == TRUE. -
TRUE or FALSE and FALSEisTRUE or (FALSE and FALSE). -
every … satisfies $n > 0 or BT-00-Text is present: theorbelongs to the condition aftersatisfies. -
if TRUE then 1 else 2 + 3isif TRUE then 1 else (2 + 3).
EFX has no unary minus, that is, no minus sign that you can put before any expression to change its sign. A minus sign before a number literal or a duration literal is part of the
literal, as in -3 or -P1D. EFX has no negation operator either: not(…) is a function, and the word not in
not in, not like and is not … is part of those operators.
See also: Operators, Conditional expression, Iteration, Quantified expression