pTAL Conversion Guide

pTAL Conversion Guide527302-002
12-1
12 Equivalenced Variables
Equivalenced variables in pTAL are more restricted than in TAL. TAL imposes very few
limitations on equivalenced declarations. In pTAL, you can equivalence only specific,
well-defined combinations of variables.
pTAL supports the following new features for equivalenced variables:
Topics:
Terminology on page 12-1
Declaring Equivalenced Nonstructures on page 12-4
Declaring Equivalenced Structures on page 12-6
Declaring Equivalenced Variables on page 12-8
Equivalencing PROCADDRs and PROCPTRs on page 12-14
Using Structure Variants on page 12-15
Using a REFALIGNED Clause With Equivalenced Declarations on page 12-16
Using the FIELDALIGN Clause on page 12-17
Declaring Address-Based Equivalenced Variables on page 12-17
Using Equivalenced Variables on page 12-18
Terminology
Equivalenced variable and previous variable
The identifier that appears on the left side of an equivalenced declaration is the
equivalenced variable. The identifier that appears on the right side of the
equivalenced declaration is the previous variable:
INT previous;
INT equivalenced = previous;
The previous variable can be an equivalenced variable:
INT base_previous;
INT equivalenced1 = base_previous;
INT equivalenced2 = equivalenced1;
Declaration New pTAL Feature (Optional)
Equivalenced pointer REFALIGNED clause
Equivalenced structure FIELDALIGN clause
Equivalenced variable Array bounds