pTAL Reference Manual (G06.24+, H06.09+, J06.03+)
Example 95 Array Redefinition
STRUCT .s;
BEGIN
INT a[0:3];
INT(32) b[0:1] = a; ! Redefine INT array as INT(32) array
END;
Definition Substructure
A definition substructure redefinition associates a new definition substructure with a previous item
at the same BEGIN-END level of a structure.
identifier
is the identifier of the new substructure.
range
lower-bound
is an INT constant expression (in the range -32,768 through 32,767) that specifies the
index (relative to the zeroth substructure occurrence) of the first substructure occurrence you
want allocated. Each occurrence is one copy of the substructure.
upper-bound
is an INT constant expression (in the range -32,768 through 32,767) that specifies the
index (relative to the zeroth substructure occurrence) of the last substructure occurrence you
want allocated.
To declare a single-occurrence substructure, omit both bounds or specify the same value
for both bounds.
field-alignment
FIELDALIGN
specifies how you want the compiler to align the base of the structure and fields in the
structure. The offsets of fields in a structure are aligned relative to the base of the structure.
If a definition substructure does not specify a FIELDALIGN clause, the contained substructure’s
field alignment is the field alignment of its encompassing structure or substructure.
If you do not specify a FIELDALIGN clause on a structure declaration, pTAL uses the current
value of the FIELDALIGN compiler directive. The default value of the FIELDALIGN directive
is AUTO.
Declaring Redefinitions 155