5. Embedded QUEL for Ada : Ada Variables and Data Types : Variable and Type Declarations : Array Type Definitions
 
Share this page                  
Array Type Definitions
The syntax of an EQUEL/Ada array type definition is:
array (dimensions) of type_name;
In the context of a type declaration, the syntax is:
type identifier is array (dimensions) of
              
type_name [type_constraint];
Syntax Notes:
1. The dimensions of an array specification are not parsed by the EQUEL preprocessor. Consequently, unconstrained array bounds and multidimensional array bounds will be accepted by the preprocessor. However, an illegal dimension (such as a non-numeric expression) will also be accepted but will later cause Ada compiler errors. For example, both of the following type declarations are accepted, even though only the first is legal in Ada:
## type Square is array(1..10, 1..10) of Integer;
## type What is array("dimensions") of Float;
Because the preprocessor does not store the array dimensions, it only checks to determine that when the array variable is used, it is followed by a subscript in parentheses.
2. The type_constraint for array types is treated as a variable type constraint and is not processed. The type information is determined from type_name.
3. Any array built from the base type character (not string) must be exactly one-dimensional. EQUEL will treat the whole array as though it were declared as type string. If more dimensions are declared for a variable of type character, EQUEL will still treat it as a one-dimensional array.
4. The type string is the only array type.