Definition Attributes
Data Definition Language (DDL) Reference Manual — 426798-002
6- 69
TYPE Clause
In the preceding examples, note that a simple variable of type BIT_1_DEF has a
different size from the field BITS_0 in a variable of the record type BIT_STRUCT_DEF.
Bit Field Output for TACL. The following examples show how DDL translates
definitions and descriptions of bit fields into TACL source code:
DDL Type
Pascal Type
DEF Enum-Spec Begin
TYPE ENUM.
89 Val-1 Value 1.
89 Val-2 Value 3.
89 Val-3 Value 0.
End.
CONST VAL_1 = 1;
CONST VAL_2 = 3;
CONST VAL_3 = 0;
TYPE ENUM_SPEC_DEF = INT16;
DEF Bits-With-Enums.
02 Bit-Field-1 TYPE BIT 8
ENUM Enum-Spec.
02 Bit-Field-2 TYPE BIT 4.
End.
TYPE BITS_WITH_ENUMS_DEF = PACKED RECORD
BIT_FIELD_1 : INT(8);
BIT_FIELD_2 : INT(4);
FILLER_1 : INT(4);
END;
DEF Reused-Bits.
02 Data-Item Type Binary.
02 Bits-Layout-1
Redefines Data-Item.
03 F-11 TYPE BIT 5.
03 F-12 TYPE BIT 6.
03 F-13 TYPE BIT 4.
02 Bits-Layout-2
Redefines Data-Item.
03 F-21 TYPE BIT 4.
03 F-22 TYPE BIT 3.
End.
TYPE REUSED_BITS_DEF = RECORD
CASE INT16 OF
01: ( DATA_ITEM : INT16 );
02: ( BITS_LAYOUT_1 :
PACKED RECORD
F_11 : INT(5);
F_12 : INT(6);
F_13 : INT(4);
FILLER_1 : INT(1);
END );
03: ( BITS_LAYOUT_2 :
PACKED RECORD
F_21 : INT(4);
F_22 : INT(3);
FILLER_2 : INT(9);
END );
END;
DDL Type
TACL Type
DEF Bit-1 TYPE BIT 1.
?Section BIT^1 Struct
Begin
INT BIT^1;
End;
DEF New-Bit-1 TYPE Bit-1.
?Section NEW^BIT^1 Struct
Begin
INT NEW^BIT^1;
End;
DEF Bit-10 TYPE BIT 10 UNSIGNED.
?Section BIT^10 Struct
Begin
UINT BIT^10;
End;