<
Expr ::= if Expr then Expr else Expr | Expr1 Expr1 ::= Expr2 { => Expr2 }* Expr2 ::= Expr3 { || Expr3 }* Expr3 ::= Expr4 { && Expr4 }* Expr4 ::= Expr5 [ { == | != | < | > | <= | >= } Expr5 ] Expr5 ::= Expr6 { AddOp Expr6 }* AddOp ::= + | ++ | - Expr6 ::= Expr7 { MulOp Expr7 }* MulOp ::= * Expr7 ::= [ UnaryOp ] Expr8 UnaryOp ::= - | ! Expr8 ::= Primary [ TypeQual ] Primary ::= ( Expr ) | Literal | Id | List | Binding | Select | Block | FuncCall
The grammar lists the operators in increasing order of precedence. The binary operators at each precedence level are left-associative.
<
The evaluation rules for conditional, implication, disjunction, conjunction, comparison, AddOp, MulOp, UnaryOp, and parenthesized expressions are shown in Tables A.4 and A.5. There are seven remaining possibilities for a Primary: Literal, Id, List, Binding, Select, Block, and FuncCall. These are treated separately in subsequent sections.