Guide to the HP Structure Definition Language


Previous Contents Index

Notes

  1. Bitfields must be an integral number of bytes, union members, or be fully contained in a structure composed only of bit members. If they are in a structure, bit names themselves are commented out, but the appropriate amount of storage is allocated at the structure name level. USAGE IS BYTE, WORD, LONG, or QUAD is used when possible to allocate the storage; otherwise, USAGE IS BYTE OCCURS n TIMES is used.
  2. All items and aggregates are output as record definitions as follows:


    DEFINE RECORD aggregate-name_RECORD USING 
            1 aggregate-name. 
              2 member-name datatype. 
                  . 
                  . 
                  . 
            ; 
    

    The record name is composed of the top-level aggregate or item name and the string "_RECORD".

  3. A dollar sign ($) appearing in a name is replaced by a hyphen (-).

HP FORTRAN Translation Summary

The following table shows the HP SDL to HP FORTRAN language translation summary.
HP SDL Declaration HP FORTRAN Output
MODULE name IDENT string !*** MODULE name IDENT string ***
/* comment ! comment
CONSTANT x  
EQUALS n; PARAMETER x = n
EQUALS STRING "s"; CHARACTER*(*) x
PARAMETER (x = 's')
ENTRY name EXTERNAL 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-data-type data-type function-name
NAMED param-name n/a
VARIABLE n/a
ALIAS internal-name n/a
LINKAGE n/a
TYPENAME type-name n/a
STRUCTURE If this is a top-level AGGREGATE declaration, a HP FORTRAN STRUCTURE declaration is generated. If this is a subaggregate declaration, no structure is generated.
UNION UNION and associated MAP declarations
name BYTE [SIGNED ] BYTE name
name INTEGER _BYTE [SIGNED ] INTEGER *1 name
name WORD [SIGNED ] INTEGER *2 name
name INTEGER _WORD [SIGNED ] INTEGER *2 name
name LONGWORD [SIGNED ] INTEGER *4 name
name INTEGER _LONG [SIGNED ] INTEGER *4 name
name INTEGER [SIGNED ] INTEGER *4 name
name INTEGER _HW [SIGNED ] INTEGER *8 for /ALPHA
  INTEGER *4 name for /VAX
name HARDWARE _INTEGER [SIGNED ] INTEGER *8 for /ALPHA
  INTEGER *4 name for /VAX
name QUADWORD [SIGNED ] INTEGER *4 name(2)
name INTEGER _QUAD [SIGNED ] INTEGER *8 for /ALPHA
  INTEGER *4 name(2) for /VAX
name OCTAWORD [SIGNED ] INTEGER *4 name(4)
name BYTE UNSIGNED BYTE name
name INTEGER _BYTE UNSIGNED BYTE name
name WORD UNSIGNED INTEGER *2 name
name INTEGER _WORD UNSIGNED INTEGER *2 name
name LONGWORD UNSIGNED INTEGER *4 name
name INTEGER _LONG UNSIGNED INTEGER *4 name
name INTEGER UNSIGNED INTEGER *4 name
name INTEGER _HW UNSIGNED INTEGER *8 for /ALPHA
  INTEGER *4 name for /VAX
name HARDWARE _INTEGER UNSIGNED INTEGER *8 for /ALPHA
  INTEGER *4 name for /VAX
name QUADWORD UNSIGNED INTEGER *4 name(2)
name INTEGER _QUAD UNSIGNED INTEGER *8 for /ALPHA
  INTEGER *4 name(2) for /VAX
name OCTAWORD UNSIGNED INTEGER *4 name(4)
name F_FLOATING REAL*4 name
name D_FLOATING REAL*8 name
name G_FLOATING REAL*8 name
name H_FLOATING REAL*16 name
name F_FLOATING COMPLEX COMPLEX name
name D_FLOATING COMPLEX COMPLEX*16 name
name G_FLOATING COMPLEX COMPLEX*16 name
name H _FLOATING COMPLEX BYTE %FILL (32)
DECIMAL PRECISION (p,q) Undefined data type; error INVOUT
BITFIELD Offset and size declarations with "V_" and "S_" tags
LENGTH n n specifies the size for size declaration
MASK Mask declaration, with "M" tag
SIGNED n/a
name CHARACTER CHARACTER*n name
LENGTH n CHARACTER*n name
LENGTH * n/a
VARYING STRUCTURE/name/name
  INTEGER*2 LEN
  CHARACTER*length TXT
  END STRUCTURE
name ADDRESS INTEGER *4 name
name POINTER INTEGER *4 name
name POINTER _LONG INTEGER *4 name
name POINTER _HW INTEGER *8 name for /ALPHA
  INTEGER *4 name for /VAX
name HARDWARE _ADDRESS INTEGER *8 name for /ALPHA
  INTEGER *4 name for /VAX
name POINTER _QUAD INTEGER *8 name for /ALPHA
  INTEGER *4 name(2) for /VAX
name BOOLEAN BYTE name
name user-type-name data-type name ! type is "user-type-name"
Default storage class Local, static
COMMON storage class RECORD /name/ name
  COMMON /name/ name
GLOBAL storage class n/a
with /GLOBALDEF n/a
BASED pointer-name n/a
TYPEDEF For an ITEM, a comment is generated. For an AGGREGATE, the behavior is as though TYPEDEF had not been specified.
DIMENSION [lbound:]hbound name(hbound - lbound)
ORIGIN member-name n/a

Note

Because HP FORTRAN does not have a comparable data type for BITFIELD, the HP FORTRAN back end translates bitfields to PARAMETERS with the same value as that of the associated structure offset. BYTE fillers (using the HP FORTRAN %FILL feature) are placed in the structures for alignment.


HP MACRO Translation Summary

The following table shows the HP SDL to HP MACRO language translation summary.
HP SDL Declaration HP MACRO Output
MODULE name IDENT string .MACRO name ;IDENT string
/* comment ;comment
CONSTANT x  
EQUALS n; If /NOVMS_DEVELOMENT (default), generates: x'..equ'n
  If /VMS_DEVELOPMENT is specified, generates: $EQU x n
EQUALS STRING "s"; See Note 2.
ENTRY If /NOVMS_DEVELOPMENT (default), generates: ;EXTERNAL entry entry-name
  If /VMS_DEVELOPMENT, generates a special set of macros that facilitate calling of the routine using either the CALLG or CALLS instruction.
PARAMETER (type,...) If /VMS_DEVELOPMENT, generates the formal argument list for keyword macros associated with the ENTRY declaration
ANY n/a
DESCRIPTOR n/a
RTL_STR_DESC n/a
IN n/a
OUT n/a
NAMED param-name If /VMS_DEVELOPMENT, param-name becomes a formal argument name used in the argument list for keyword macros associated with the ENTRY declaration
VALUE n/a
REFERENCE n/a
DEFAULT n If /VMS_DEVELOPMENT, n becomes a default value in the macro argument list for the parameter being described
LIST Fills the macro argument list with up to 20 parameters of the type of the parameter being described
OPTIONAL Generates an "OPTIONAL" macro argument, which either defaults to 0 or is truncated from the actual argument list when the macro is expanded
TYPENAME type-name n/a
RETURNS return-data-type n/a
NAMED param-name n/a
VARIABLE If /VMS_DEVELOPMENT, causes a special form of macro to be generated that handles a variable number of parameters. See also LIST.
ALIAS internal-name Macro name (default is entry name)
LINKAGE Call instruction (default is CALLS)
TYPENAME type-name n/a
STRUCTURE See Note 1.
name BYTE [SIGNED ] .
name INTEGER _BYTE [SIGNED ] .
name WORD [SIGNED ] .
name INTEGER _WORD [SIGNED ] .
name LONGWORD [SIGNED ] .
name INTEGER _LONG [SIGNED ] .
name INTEGER [SIGNED ] .
name INTEGER _HW [SIGNED ] .
name HARDWARE _INTEGER [SIGNED ] .
name QUADWORD [SIGNED ] .
name INTEGER _QUADWORD [SIGNED ] .
name OCTAWORD [SIGNED ] .
name BYTE UNSIGNED .
name INTEGER _BYTE UNSIGNED .
name WORD UNSIGNED .
name INTEGER _WORD UNSIGNED .
name LONGWORD UNSIGNED .
name INTEGER _LONG UNSIGNED .
name INTEGER UNSIGNED .
name INTEGER _HW UNSIGNED .
name HARDWARE _INTEGER UNSIGNED .
name QUADWORD UNSIGNED .
name INTEGER _QUADWORD UNSIGNED .
name OCTAWORD UNSIGNED .
name F_FLOATING .
name D_FLOATING .
name G_FLOATING .
name H_FLOATING .
name F_FLOATING COMPLEX .
name D_FLOATING COMPLEX .
name G_FLOATING COMPLEX .
name H_FLOATING COMPLEX .
name DECIMAL PRECISION (p,q) .
name ADDRESS .
name POINTER .
name POINTER _LONG .
name POINTER _HW .
name HARDWARE _ADDRESS .
name POINTER _QUAD .
name BOOLEAN .
name user-type-name .
name CHARACTER .
LENGTH n n/a
LENGTH * n/a
VARYING n/a
name BITFIELD LENGTH n Bitfield identifiers are equal to the bit offset of the item, and a prefix$_name identifier is equal to the size of the bitfield in bits; see Note 1.
MASK Mask declarations are constants with the "m_" tag
SIGNED n/a; see Note 1.
Default storage class The aggregate is placed in the absolute Psect $ABS$, and the value of the current location counter is set to the origin at the beginning of the aggregate. Element names can then be used as displacements off a register that contains the address of the actual aggregate.
COMMON storage class An aggregate or item is placed in a Psect that has the same name as the top-level aggregate or item, and the attributes SHR, GBL, and OVR. Constant offsets are produced for all aggregate members.
GLOBAL storage class Generates .EXTERNAL declaration for the top-level name, and produces offset constants for any aggregate members.
with /GLOBALDEF Generates .GLOBAL declaration and BLKB length for top-level name, and produces offset constants for any aggregate members.
BASED pointer-name n/a
TYPEDEF n/a
DIMENSION [lbound:]hbound Offsets are appropriately adjusted to allow for the size of the array.
ORIGIN member-name Aggregate members preceding member-name may be referenced using negative offsets with member-name as the base.


Previous Next Contents Index