Chapter 5. Expressions

An expression is a sequence of operators and operands. This chapter defines the syntax, order of evaluation of operands and operators, and meaning of expressions.

5.1 Operators

Expressions are constructed from operands and operators. The operators of an expression indicate which operations to apply to the operands. Examples of operators include +, -, *, and /. Examples of operands include literals, fields, and expressions.

There are the following kinds of operators:

• Unary operators take one operand and use prefix notation such as -x.

• Binary operators take two operands and use infix notation such as x + y.

• Ternary operator. Only one ternary operator, ?:, exists; it takes three operands and uses infix notation (c? x: ...

Get The “Oslo” Modeling Language now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.