PowerAda 43

From OC Systems Wiki!
< PowerAda:APPENDIX C. Implementation Characteristics‎ | Annex M
Revision as of 00:35, 25 April 2019 by imported>WikiVisor (Text replacement - ">" to ">")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

(43) The interpretation of each aspect of representation.

See 13.1(20).


enumeration_representation_clause
The compiler supports representation clauses for enumeration types, as described in RM Section 13.4. The values specified in an enumeration representation clause must be within the bounds of type INTEGER. The specification of a representation clause for an enumeration type causes the generation of a position table that maps each enumeration value to its position (0, 1, ...). The position is used for arrays indexed with the enumeration type and to implement attributes `POS,`IMAGE, and `VALUE, `WIDTH.
record_representation_clause
Record representation clauses are supported as described in Section 13.5.1 of the RM.
Component_Size clause
Componet_Size clauses are supported as described in Section 13.3(71) of the RM.
External_Tag clause
The 'External_Tag clause is supported as described in Section 13.3(75) of the RM.
Small clause
If a length clause is used, the model numbers are multiples of the specified value for SMALL. Using values that are not powers of 2 for 'SMALL results in slower code for multiplication and division operations, because of the extra rounding that the program must do.
The effect of the length clause is to use this value of 'SMALL for the representation of values of the fixed point-base type. The length clause also affects the amount of storage for objects that have this type.
Bit_Order clause
The 'Bit_Order attribute is implemented as described in Section 13.5.3. Note that in PowerAda Word_Size > Storage_Unit thus the only supported value in an attribute_definition_clause is SYSTEM.HIGH_ORDER_FIRST.
Storage_Pool clause
The 'Storage_Pool attribute is supported as specified in 13.11(13).
Storage_Size clause
A length clause that uses the STORAGE_SIZE attribute for a task type specifies the number of bytes to be reserved for an activation of a task of the type. The compiler creates a stack of at least 32K bytes for each task that has no Storage_Size clause specified.
Read clause
The 'Read clause is supported as specified in 13.13.2(36).
Write clause
The 'Write clause is supported as specified in 13.13.2(36).
Input clause
The 'Input clause is supported as specified in 13.13.2(36).
Output clause
The 'Output clause is supported as specified in 13.13.2(36).
Machine_Radix clause
The 'Machine_Radix attribute is supported as specified in section A.5.4(2) of the RM. The only allowed value in an attribute definition clause using this attribute is 2.
pragma Pack
Pragma PACK allocates components of records and arrays to minimize storage requirements. PowerAda implements packing of records and arrays, provided that they have no components whose size cannot be determined at compile time. For example, pragma PACK has no effect upon a record that has a component whose size depends upon a discriminant.
pragmas Import, Export, and Convention (when applied to a type)
Pragmas Import, Export, and Convention have no effect on a type except to disable default reordering of components in a record type.
pragmas Atomic and Volatile (when applied to a type)
Pragmas Atomic and Volatile are supported as specified in annex C.6 in the LM.
pragmas Atomic_Components and Volatile_Components (when applied to an array type)
Pragmas Atomic_Components and Volatile_Components are supported as specified in annex C.6 in the LM.
pragma Discard_Names (when applied to an enumeration or tagged type)
Pragma Discard_Names is supported as specified in annex C.5.
Alignment clause (when applied to a first subtype)
The 'Alignment attribute is supported as specified in section 13.3(23) in the RM.
Size clause (when applied to a first subtype)
The size specification for a type must allow for enough storage space to accommodate every allowable value in the type.
Incorrect size specifications are detected at compile time. If you specify the SIZE attribute for a composite type, all constraints on an object of the type and on its subcomponents must be static. For an unconstrained array type, the index subtypes must also be static.
No sign bit is included in the size calculation for non-negative ranges. Biased representations are not supported; for instance, a range of 100 through 101 requires 7 bits, not 1. Note that if you use a size clause for a discrete type, inefficient code may be generated.
For floating-point and access types, a size clause has no effect on the representation. Task types are implemented as access types and are also unaffected by size clauses.
For composite types such as arrays or records, a size clause acts like an implicit pragma PACK, followed by a check that the resulting size is no greater than the requested size. Note that the composite type will be packed whether or not it is necessary to meet the requested size.
Address clause (applies to objects and program units)
Address clauses with the name of an object are supported (see RM Section 13.3(12)).
Address clauses with the name of a subprogram, package, or task unit (see RM Section 13.3(12)) are supported. The clause returns the address of a function descriptor. When an address clause is used as an attribute definition clause is specifies the address of a function descriptor to be used to call the named subprogram. It is the responsibility of the programmer to guarantee that the function descriptor has been correctly initialized. If the named subprogram also has an IMPORT pragma applied to it the link name parameter must not be specified in the pragma.
Alignment clause (when applied to an object)
The 'Alignment attribute is supported as specified in section 13.3(23) in the RM.
Size clause (when applied to an object)
Size clauses for objects are supported as specified in section 13.3(40) of the RM.
pragmas Import, Export, and Convention (when applied to anything other than a type)
Pragmas Import, Export, and Convention when applied to a subprogram will eliminate any implicitly passed parameters except those associated with an unconstrained function return value. When applied to an object these pragmas have no effect other than to establish the linkname.
pragmas Atomic and Volatile (when applied to an object or a component)
Pragmas Atomic and Volatile are supported as specified in annex C.6 in the LM.
pragmas Atomic_Components and Volatile_Components (when applied to an array object)
Pragmas Atomic_Components and Volatile_Components are supported as specified in annex C.6 of the LM.
pragma Discard_Names (when applied to an exception)
Pragma Discard_Names is supported as specified in annex C.5 of the LM.
pragma Asynchronous (applies to procedures)
Pragma Asynchronous is not yet implemented.