Expresiones

Explicación

Una expresión es una fórmula que define cómo se calcula o recupera un valor. La expresión se dice que es del tipo del valor que representa (por ejemplo, una expresión booleana es una que da como resultado un valor de tipo Boolean).

Sintaxis

expression ::= 
relation {and relation} | relation {and then relation}
| relation {or relation} | relation {or else relation}
| relation {xor relation}
relation ::=
simple_expression [relational_operator simple_expression]
| simple_expression [not] in rango
| simple_expression [not] in subtype_mark
simple_expression ::= [unary_adding_operator] term {binary_adding_operator term}
term ::= factor {multiplying_operator factor}
factor ::= primary [** primary] | abs primary | not primary
primary ::=
numeric_literal | null | string_literal | aggregate
| name | qualified_expression | allocator | (expression)

Ejemplos

X and Y        --  expression
(A + 3.5) <= B --  relation
A in Natural   --  relation
-3.5           --  simple_expression
A + 3.5        --  simple_expression
A * B          --  term
A              --  name
3.5            --  numeric_literal
Integer'First  --  qualified_expression
(A + 3.5)      --  (expression)