![]() |
![]() |
![]() |
![]() |
![]() |
The keyword is used to specify user-defined structured types.
type ( record | union | set | record of | set of | enumerated | port | component ) identifier { body }; |
The type keyword introduces the type definition.
record denotes an ordered structured type.
union is a structure which can take one and only one of a finite number of known types.
set denotes an unordered structured type.
record of denotes a record the elements of which are all of the same type.
set of denotes a set the elements of which are all of the same type.
enumerated stands for a type that take only a distinct named set of values.
port defines the messages or procedures allowed to pass the port in question.
component defines which ports are associated with a component.
identifier is the name used to refer to the structured type. Must begin with a letter, may contain letters, numbers and underscore characters.
body contains the type definition itself. Its content differs from type to type.
Another use of the keyword is the subtype definition.
type parent_identifier (identifier | address) [array_def] [(list)] [length] ; |
The type keyword introduces the type definition.
parent_identifier is the name used to refer to the parent type. Must begin with a letter, may contain letters, numbers and underscore characters.
identifier is the name used to refer to the sub-type. Must begin with a letter, may contain letters, numbers and underscore characters.
address is a user defined type to allow addressing specific entities inside the System Under Test.
array_def restricts the indices of the parent type.
list is a comma-separated enumeration of the allowed values out of the values defined for the parent type.
length can be used with set of and record
of types to limit the number of the elements of the structured type in question.
When the parent type is a basic string type, the keyword constraints the length of the string.
Example 1:
type enumerated Example {tisdag, fredag, onsdag};
The enumerated type called Example containing three elements is defined.
Example 2:
type Ex_subt Example (tisdag, onsdag);
The sub-type, called Ex_subt, may contain only two elements of the parent type (called Example).
BNF definition of type