[NEXT] [PREV]
HANDBOOK
/ CASE STUDY
/ The Source Language
/Data Types 

Gentle
Applications Concepts Examples Handbook Support Download

A data type determines the set of values which variables of that type may assume. Type ::= SimpleType  ArrayType Simple Types
SimpleType ::= 'INTEGER'  'REAL'  'BOOLEAN'The values of type INTEGER are a subset of the whole numbers defined by individual implementations. Its values are the integers. The values of type REAL are a subset of the real numbers depending on a particular implementation. The values are denoted by real numbers. The values of type BOOLEAN are the truth values denoted by the reserved identifiers TRUE and FALSE.
Array TypesAn array type is a structure consisting of a fixed number of components which are all of the same type, called the component type. The elements of the array are designated by integer indices. The array type specifies the component type as well as a subrange of the integers to be used as indices.ArrayType ::= 'ARRAY' '[' IntConst '..' IntConst ']' 'OF' TypeExamples: ARRAY [1..100] OF INTEGER ARRAY [4..7] OF ARRAY [2..2] OF BOOLEANThe index range must contain at least one element, i.e. the lower bound of an index range must not exceed the upper bound. 