Expressions

This section contains information about expressions. The expressions are presented in alphabetical order.

An expression describes how a value can be obtained by applying specified operations to designated operands or primaries.

<expression>

──┬─<arithmetic expression>───────┬────────────────────────────────────┤
  ├─<bit manipulation expression>─┤
  ├─<Boolean expression>──────────┤
  ├─<case expression>─────────────┤
  ├─<complex expression>──────────┤
  ├─<conditional expression>──────┤
  ├─<designational expression>────┤
  ├─<function expression>─────────┤
  ├─<null value>──────────────────┤
  ├─<pointer expression>──────────┤
  └─<string expression>───────────┘

The evaluation of each expression returns a different value, as follows:

Expression

Value

Arithmetic

Numerical

Boolean

Boolean (TRUE or FALSE)

Complex

Complex: a real numerical part and an imaginary numerical part

Designational

Label

Pointer

A value that can be used to reference a character position in an array row

String

A value that is an EBCDIC, ASCII, or hexadecimal string

A bit manipulation expression operates on bits within words and makes it possible to build the contents of a word from groups of bits contained in other words.

Case expressions and conditional expressions allow one of several alternative expressions to be chosen for evaluation based on a selection value.

A function expression is a call on a typed procedure. The procedure can be declared in the program or it can be an intrinsic which is a typed procedure that is a predefined part of the ALGOL language. Intrinsic functions exist that are predefined arithmetic expressions, predefined Boolean expressions, predefined complex expressions, predefined pointer expressions, and predefined string expressions. For example, SQRT(<arithmetic expression>) is a function expression that returns the square root of the value of <arithmetic expression> construct. Because the SQRT returns a numeric value, it is an arithmetic function, a predefined arithmetic expression.

Note: Expressions that are very large or deeply nested can cause the compiler to receive a stack overflow fault. The fault can be avoided by breaking very large or deeply nested expressions into several separate expressions or by increasing the maximum stack size by using the task attribute STACKLIMIT.