pTAL Reference Manual (G06.24+, H06.09+, J06.03+)

Example 93 Declaring a Structure Pointer Within a Structure
STRUCT struct_a;
BEGIN
INT a;
INT b;
END;
STRUCT struct_b;
BEGIN
INT .EXT struct_pointer (struct_a);
STRING a;
END;
Declaring Redefinitions
A redefinition declares a new identifier and sometimes a new description for a previous item in
the same structure.
The following rules apply to all redefinitions in structures:
The new item must be of the same length or shorter than the previous item.
The new item and the previous item must be at the same BEGIN-END level of a structure.
Additional rules are given in subsections that describe each kind of redefinition in the following
topics:
Simple Variable (page 153)
Array (page 154)
Definition Substructure (page 155)
Referral Substructure (page 157)
Simple Pointer (page 158)
Structure Pointer (page 159)
For information about redefinitions outside structures, see Chapter 11 (page 177).
Simple Variable
A simple variable redefinition associates a new simple variable with a previous item at the same
BEGIN-END level of a structure.
VOLATILE
specifies that the value of this variable must be maintained in memory, not in a register. Each
reference to a VOLATILE data item causes the data item to be read or written to memory even
when code is optimized. Based on the order of reads and writes in the source code, VOLATILE
also causes that precise order of memory references to be preserved, again, when code is
optimized.
type
is any data type except UNSIGNED.
identifier
is the identifier of the new simple variable.
Declaring Redefinitions 153