Guide to the HP Structure Definition Language


Previous Contents Index

Notes

  1. The HP BLISS output routine does not assign data to storage classes.
  2. For all literals above, size is given in bytes.

HP C/C++ Translation Summary

The C backend differentiates along the qualifiers /ALPHA vs. /VAX, /[NO]VMS_DEVELOPMENT, and /[NO]C_DEVELOPMENT.
/VMS_DEVELOPMENT and /C_DEVELOPMENT can be combined.
When /C_DEVELOPMENT is present, every definition is translated twice, once between


#ifdef __NEW_STARLET 
 
    /* translation */ 
 
#else       /* __OLD_STARLET */ 
and once between


#else       /* __OLD_STARLET */ 
 
    /* possibly different translation */ 
 
#endif      /* #ifdef __NEW_STARLET */ 

So there are 12 possibly different translations for a single data type. To make the translation summary more readable, abbreviations are used.
Abbreviation Qualifier combination
a /ALPHA
b /ALPHA/VMS _DEVELOPMENT
c /ALPHA/VMS _DEVELOPMENT/C _DEVELOPMENT, #ifdef __NEW_STARLET
d /ALPHA/VMS _DEVELOPMENT/C _DEVELOPMENT, #else
e /ALPHA/C _DEVELOPMENT, #ifdef __NEW_STARLET
f /ALPHA/C _DEVELOPMENT, #else
g /VAX
h /VAX/VMS _DEVELOPMENT
i /VAX/VMS _DEVELOPMENT/C _DEVELOPMENT, #ifdef __NEW_STARLET
j /VAX/VMS _DEVELOPMENT/C _DEVELOPMENT, #else
k /VAX/C _DEVELOPMENT, #ifdef __NEW_STARLET
l /VAX/C _DEVELOPMENT, #else

The following table shows the HP SDL to HP C/C++ language translation summary.
HP SDL Declaration HP C/C++ Output
MODULE name IDENT string /*** MODULE name IDENT string ***/
/* comment /* comment */
CONSTANT x  
EQUALS n; #define x n
EQUALS STRING "s"; #define x "s"
ENTRY name return-type name()
PARAMETER (type,...) n/a
ANY n/a
DESCRIPTOR n/a
RTL_STR_DESC n/a
IN n/a
OUT n/a
NAMED param-name n/a
VALUE n/a
REFERENCE n/a
DEFAULT n n/a
LIST n/a
OPTIONAL n/a
TYPENAME type-name n/a
RETURNS return-type return-type name()
NAMED param-name n/a
VARIABLE n/a
ALIAS internal-name n/a
LINKAGE n/a
TYPENAME type-name n/a
STRUCTURE struct
UNION union
name BYTE [SIGNED ] char name
name INTEGER _BYTE [SIGNED ] char name
name WORD [SIGNED ] short int name
name INTEGER _WORD [SIGNED ] short int name
name LONGWORD [SIGNED ] int name
name INTEGER _LONG [SIGNED ] int name
name INTEGER [SIGNED ] int name
name INTEGER _HW [SIGNED ] int name for g-l
  _ _int64 name for a-f
name HARDWARE _INTEGER [SIGNED ] int name for g-l
  _ _int64 name for a-f
name QUADWORD [SIGNED ] int name [2 ] for a, d, f, g, h, j, l
  _ _int64 name for b, c, e, i, k
name INTEGER _QUAD [SIGNED ] int name [2 ] for g-l
  _ _int64 name for a-f
name OCTAWORD [SIGNED ] int name [4 ]
name BYTE UNSIGNED unsigned char
name INTEGER _BYTE UNSIGNED unsigned char
name WORD UNSIGNED unsigned short int
name INTEGER _WORD UNSIGNED unsigned short int
name INTEGER _LONGWORD UNSIGNED unsigned int
name INTEGER _LONG UNSIGNED unsigned int
name INTEGER UNSIGNED unsigned int
name INTEGER _HW UNSIGNED unsigned int name for g-l
  unsigned _ _int64 name for a-f
name HARDWARE _INTEGER UNSIGNED unsigned int name for g-l
  unsigned _ _int64 name for a-f
name QUADWORD UNSIGNED unsigned int name [2 ] for a, d, f, g, h, j, l
  unsigned _ _int64 name for b, c, e, i, k
name INTEGER _QUAD UNSIGNED unsigned int name [2 ] for g-l
  unsigned _ _int64 name for a-f
name OCTAWORD UNSIGNED unsigned int name [4 ]
name F_FLOATING float name
name D_FLOATING double float name
name G_FLOATING double float name
name H_FLOATING int name [4]
name F_FLOATING COMPLEX float name [2]
name D_FLOATING COMPLEX double float name [2]
name G_FLOATING COMPLEX double float name [2]
name H_FLOATING COMPLEX int name [8]
name DECIMAL PRECISION (p,q) char name [p/2+1]
name BITFIELD unsigned name:1
LENGTH n unsigned name:n
MASK n/a
SIGNED n/a
name CHARACTER char name
LENGTH n char name [n]
LENGTH * n/a
VARYING struct {short string_length; char string_text[n];} name; where n is the maximum length of the character string
name ADDRESS (object-type) object-type *name for a-c, e, g-i, k
  void * for d, f, j, l
name POINTER (object-type) object-type *name for a-c, e, g-i, k
  unsigned int for d, f, j, l
name POINTER _LONG (object-type) object-type *name for a-k
name POINTER _HW (object-type) object-type *name for a, g-i, k
  ( 1 ) for b-c, e
  unsigned _ _int64 name for d, f
  unsigned int for j, l
name HARDWARE _ADDRESS (object-type) object-type *name for a-k
name POINTER _QUAD (object-type) object-type *name for a, g
  ( 1 ) for b-c, e, h, i, k
  unsigned _ _int64 name for d, f
  unsigned int name [2 ] for j, l
name BOOLEAN char name
name user-type-name user-type-name name
Default storage class struct or union with <member-name> as the tag, and no declared variable names
COMMON storage class extern attribute
GLOBAL storage class globalref attribute
with /GLOBALDEF globaldef attribute
BASED pointer-name A pointer will be generated for the based item
TYPEDEF For an AGGREGATE, a TYPEDEF STRUCT is generated. In this case, a pre-tag is generated as well as the post-tag. The pre-tag consists of the structure named prefixed by an underscore. Any reference to the structure type within the definition (such as for forward and backward linkages) is also output with the underscore. For an ITEM, the TYPEDEF keyword is generated, followed by the data type of the ITEM.
DIMENSION [lbound:]hbound The declaration specifies an array of the number of elements specified with subscripts ranging from 0 to (hbound - lbound + 1)
ORIGIN member-name n/a


1 #ifdef __INITIAL_POINTER_SIZE #pragma __required_pointer_size __long object-type *name; #else unsigned __int64 name; #endif

HP DATATRIEVE Translation Summary

The following table shows the HP SDL to HP DATATRIEVE language translation summary.
HP SDL Declaration HP DATATRIEVE Output
MODULE name IDENT string ! *** MODULE name IDENT string ***
/* comment ! comment
CONSTANT x EQUALS n; ! x=n
ENTRY ! name ENTRY
PARAMETER (type,...) n/a
ANY n/a
DESCRIPTOR n/a
RTL_STR_DESC n/a
IN n/a
OUT n/a
NAMED param-name n/a
VALUE n/a
REFERENCE n/a
DEFAULT n n/a
LIST n/a
OPTIONAL n/a
TYPENAME type-name n/a
RETURNS return-data-type n/a
NAMED param-name n/a
VARIABLE n/a
ALIAS internal-name n/a
LINKAGE n/a
TYPENAME type-name n/a
STRUCTURE A group field declaration. An AGGREGATE declaration is always assigned a level number of 1; subsequent subaggregates are assigned level numbers 2, 3, and so on.
UNION A group field declaration, with level numbers assigned as above. All but the first union member have a REDEFINES first-field-name clause. The redefined fields cannot be larger than the first union member.
BYTE [SIGNED ] USAGE IS BYTE
INTEGER _BYTE [SIGNED ] USAGE IS BYTE
WORD [SIGNED ] USAGE IS WORD
INTEGER _WORD [SIGNED ] USAGE IS WORD
LONGWORD [SIGNED ] USAGE IS LONG
INTEGER _LONG [SIGNED ] USAGE IS LONG
INTEGER [SIGNED ] USAGE IS LONG
INTEGER _HW [SIGNED ] USAGE IS QUAD for /ALPHA
  USAGE IS LONG for /VAX
HARDWARE _INTEGER [SIGNED ] USAGE IS QUAD for /ALPHA
  USAGE IS LONG for /VAX
QUADWORD [SIGNED ] USAGE IS QUAD
INTEGER _QUAD [SIGNED ] USAGE IS QUAD
OCTAWORD [SIGNED ] USAGE IS QUAD OCCURS 2 TIMES
BYTE UNSIGNED USAGE IS BYTE
INTEGER _BYTE UNSIGNED USAGE IS BYTE
WORD UNSIGNED USAGE IS WORD
INTEGER _WORD UNSIGNED USAGE IS WORD
LONGWORD UNSIGNED USAGE IS LONG
INTEGER _LONG UNSIGNED USAGE IS LONG
INTEGER UNSIGNED USAGE IS LONG
INTEGER _HW UNSIGNED USAGE IS QUAD for /ALPHA
  USAGE IS LONG for /VAX
HARDWARE _INTEGER UNSIGNED USAGE IS QUAD for /ALPHA
  USAGE IS LONG for /VAX
QUADWORD UNSIGNED USAGE IS QUAD
INTEGER _QUAD UNSIGNED USAGE IS QUAD
OCTAWORD UNSIGNED USAGE IS QUAD OCCURS 2 TIMES
F_FLOATING USAGE IS REAL
D_FLOATING USAGE IS DOUBLE
G_FLOATING USAGE IS DOUBLE
H_FLOATING USAGE IS QUAD OCCURS 2 TIMES
F_FLOATING COMPLEX USAGE IS REAL OCCURS 2 TIMES
D_FLOATING COMPLEX USAGE IS DOUBLE OCCURS 2 TIMES
G_FLOATING COMPLEX USAGE IS DOUBLE OCCURS 2 TIMES
H_FLOATING COMPLEX USAGE IS QUAD OCCURS 2 TIMES
DECIMAL PRECISION (p,q) USAGE IS PACKED PIC 9(p-q)V9(q)
BITFIELD ! name BIT position:size
  See the description following the table
LENGTH n ! name BIT position:n
MASK ! maskname = value
SIGNED n/a
CHARACTER PIC X(n)
LENGTH n X(n)
LENGTH * n/a
VARYING A group field of the form:
  level field-name
  level+1 STRING_LENGTH USAGE IS WORD
  level+1 STRING_TEXT PIC X(n)
ADDRESS USAGE IS LONG
POINTER USAGE IS LONG
POINTER _LONG USAGE IS LONG
POINTER _HW USAGE IS QUAD for /ALPHA
  USAGE IS LONG for /VAX
HARDWARE _ADDRESS USAGE IS QUAD for /ALPHA
  USAGE IS LONG for /VAX
POINTER _QUAD USAGE IS QUAD
BOOLEAN USAGE IS BYTE
Default storage class n/a
COMMON storage class n/a
GLOBAL storage class n/a
with /GLOBALDEF n/a
BASED pointer-name n/a
pointer-name USAGE IS LONG
name DIMENSION [lbound:]hbound OCCURS hbound-lbound+1 TIMES
ORIGIN member-name n/a


Previous Next Contents Index