Table of precedence

This table describes the precedence of CQL filters.

Filters in the same cell of the table have the same precedence.

The table's cells are arranged in order of increasing precedence (as you go down the table, the precedence increases). Thus, and has high precedence than or because it is further down the table.

Precedence is explained more fully here.
operation
-->, in line
<--, in line
+ wildcard
* wildcard
ancestor
descendant
distance
find
if/then/else
lca
loop
transforms, e.g. flipcolor, shift
arguments to user-defined functions
body of echo
body of piece
body of sort
body of square
constituents of a compound filter
or
and
not
in filter
<
<=
==
>=
>
!=
makesquare
abs
unary -
right side of +=
right side of -=
right side of *=
right side of /=
right side of %=
right side of persistent
sqrt
position
ascii
int
#
+(addition), -(subtraction)
lowercase
uppercase
-(unary minus)
*, /, %
rank
file
in parameter to piece
in parameter to square
between
power
type
colortype
right hand side of piece assignment
pieceid
|
~
attacks, attackedby
from parameter to pin, to parameter to pin
through parameter to pin
any direction filter: up, down, etc.
light
dark
x[] string indexing
~~ (on the left)
:

In the above table, all the operators are left associative where applicable, except for : and the relational operators, which are right associative.