The grammar rules for an expression are, in order of precedence, from high to low (note stands for the empty string):
expr:: id
number
{ atom,,atom }
expr :: expr
[-+*&|^] expr
expr ** expr
expr [*/«»] expr
expr [+-] expr
expr mod expr
expr in expr
expr union expr
expr [= =<<=>>=] expr
~ expr
expr & expr
expr [|^] expr
expr <-> expr
expr -> expr
expr ? expr : expr
expr .. expr
( expr )
[ expr,,expr ]
[ expr,,expr : atom = expr .. expr ]
bin ( expr , expr )
All operators of the same precedence except ``?:'' associate to the left. For example, a / b * c is parsed as (a / b) * c. The ternary ``?:'' associates to the right. Thus
a ? b : c ? d : eis parsed as
a ? b : (c ? d : e)