Data Types

Data Types

There are two different kinds of data types:

- An atomic type is atomic in the sense that it is not defined based on any other type and cannot be divided into parts or components, e.g. num.

- A record data type is a composite type with named, ordered components, e.g. pos. A component may be of an atomic or record type.A record value can be expressed using an aggregate representation;e.g. [ 300, 500, depth ] pos record aggregate value.A specific component of a record data can be accessed by using the name of that component; e.g. pos1.x := 300; assignment of the x-component of pos1.

Non-value data types

Each available data type is either a value data type or a non-value data type. Simply speaking, a value data type represents some form of "value". Non-value data cannot be used in value-oriented operations:

The input data types (signalai, signaldi, signalgi) are of the data type semi value. These data can be used in value-oriented operations, except initialisation and assignment. In the description of a data type it is only specified when it is a semi value or a nonvalue data type.

Equal (alias) data types

An alias data type is defined as being equal to another type. Data with the same data types can be substituted for one another. Example: VAR dionum high:=1;VAR num level; This is OK since dionum is an alias level:= high; data type for num

Syntax

<type definition>::=

[LOCAL] ( <record definition>

| <alias definition> )

| <comment>

| <TDN>

<record definition>::=

RECORD <identifier>

<record component list> ’;’

ENDRECORD

<record component list> ::=

<record component definition> |

<record component definition> <record component list>

<record component definition> ::=

<data type> <record component name>

<alias definition> ::=

ALIAS <data type> <identifier> ’;’

<data type> ::= <identifier>