5. Embedded QUEL for Ada : Ada Variables and Data Types : Variable and Type Declarations : Incomplete Type Declarations and Access Types
 
Share this page                  
Incomplete Type Declarations and Access Types
The incomplete type declaration should be used with an access type. The syntax for an incomplete type declaration is:
type identifier [discriminant_part];
Syntax Notes:
1. As with other type declarations, the discriminant_part is ignored.
2. You must fully define an incomplete type before using any object declared with it.
The syntax for an access type declaration is:
type identifier is access type_name [type_constraint];
Syntax Notes:
3. The type_name must be a predeclared type, whether it is a full type declaration or an incomplete type declaration.
4. The type_constraint has the same rules as other type declarations.
The following is an example of the incomplete type declaration:
## type Employee_Rec; -- Incomplete declaration
## type Employee is access 
##        Employee_Rec;-- Access to above

## type Employee_Rec is -- Real definition
## record
##    name: String(1..20);
##    age: Short_Short_Integer;
##    salary: Float := 0.0;
##    link: Employee;
## end record;