Contents
Up
Previous
Next


Types


In this section we discuss many different built-in types of objects that can be used, as well as how to declare new types. The built-in types are boolean, bit, character, severity_level, integer, real, time, string and bit_vector. Types that represent a subset of values represented by another type are called subtypes. There are two built-in subtypes, natural and positive.

The integer and real types represent the obvious. An integer object may have any integer value from -2147483648 to 2147483647. An object of the real type can represent values with up to 15 digits of precision. After discussing how to declare new types, the remaining built-in types can be described by specifying how they would be declared as new types.

The type and subtype definitions follow the rules:

scalar-type-definition : enumeration-type-definition | 
  integer-type-definition | real-type-definition | physical-type-definition 
composite-type-definition : array-type-definition | record-type-definition |
  file-type-definition 
type-specification : scalar-type-definition | composite-type-definition | 
  access-type-definition 
type-definition : TYPE simple-name IS type-specification ";" 
type-declaration : type-definition | incomplete-type-definition

The access, file and incomplete type definitions are discussed in the next chapter. The other kinds of types are described in the following sub-sections.

Enumeration types
Real and Integer types
Physical types
Array types
Record types