Guide to the HP Structure Definition Language


Previous Contents Index

2.2 Processing a HP SDL Source File

The SDL command invokes the HP SDL translator from DCL command level to produce output files for one or more target languages. The SDL command has the following format:

SDL[/qualifier[...]] file-spec[/qualifier[...]],... 

Section 2.1.3 describes how the SDL command and all its qualifiers can be entered from within LSE when used with the LSE command COMPILE.

Command Parameter

file-spec,...

Specifies one or more HP SDL source files to be translated. A file specification must specify a file name; if it does not include a file type, HP SDL uses the default file type .SDL. You can specify multiple input files, separated by commas. HP SDL translates each source file individually and creates separate output files for each.

Wildcards are not allowed in the file specification.

Command Qualifiers

Command qualifiers may be specified following the SDL command, or they may be used to qualify individual file specifications. Table 2-1 lists all the optional SDL command qualifiers and their defaults.

)
Table 2-1 SDL Command Qualifiers and Their Defaults
Qualifier Default
/ALIGNMENT No alignment
/ALPHA _AXP /ALPHA _AXP on Alpha and IA64 systems
/B64 none
/BACKEND _OPTION none
/ [NO ]CHECK _ALIGNMENT /NOCHECK _ALIGNMENT
/[NO]COMMENTS /COMMENTS
/[NO]COPYRIGHT /NOCOPYRIGHT
/ [NO ]C _DEVELOPMENT /NOC _DEVELOPMENT
/[NO]DUMP[=file-spec] /NODUMP
/[NO]GLOBAL_DEFINITION /NOGLOBAL_DEFINITION
/[NO]HEADER /HEADER
/LANGUAGES=(language[=file-spec],...) No languages
/[NO]LIST /NOLIST (interactive)
  /LIST (batch)
/ [NO ]MEMBER _ALIGN /NOMEMBER _ALIGN
/[NO]MODULE /MODULE
/[NO]PARSE[=file-spec] /PARSE
[/NO ]PLI _DEVELOPMENT /NOPLI _DEVELOPMENT
/ [NO ]SUBFIELDS /NOSUBFIELDS
/[NO]SUPPRESS /NOSUBFIELDS
/SYMBOLS No symbols
/VAX /VAX on VAX systems
/[NO]VMS_DEVELOPMENT /NOVMS_DEVELOPMENT

/ALIGNMENT=value

The assumed alignment. Integer value greater than zero. If specified, diagnostic messages are emitted for data items that do not fall on the assumed alignment.

/ALPHA_AXP

Note the following:

/[NO]B64

This qualifier is only valid for the languages BLISS and BLISSF.

The default extension for the output file is .R64 if /B64 is specified and .R32 otherwise.

The word size used in BITFIELDs is 64 bits if /B64 is specified and 32 bits otherwise.

The name used for conditional compilation changes from BLISS or BLISSF to BLISS64 or BLISSF64, respectively.

You cannot specify the qualifiers /B64 and /VAX together.

/[NO]BACKEND_OPTION={language=language-option}
{(language=language-option,...)}

The qualifier accepts a list of languages and a value for every language. The syntax of the value is backend-specific.

At the moment, only the CC backend supports this qualifier. It accepts the value INT64_FOR_QUAD, which indicates that the SDL quadword data type is always mapped to the C __int64 data type. This is done on 64bit-systems only (i.e. Alpha and IA64), not on VAX systems, since there is no __int64 data type on VAX systems.

/[NO]CHECK_ALIGNMENT

If specified, diagnostic messages are emitted for data items that do not fall on their natural alignment.

/[NO]COMMENTS

Controls whether output comments are included in the output file. For more compact target language representation, use the /NOCOMMENTS qualifier to save file space. The default is /COMMENTS.

/[NO]COPYRIGHT

Controls whether a standard HP copyright header is produced in the output file. The /COPYRIGHT qualifier causes the HP SDL translator to precede the output with a comment containing the standard DIGITAL copyright claim. The default is /NOCOPYRIGHT.

/[NO]C_DEVELOPMENT

Only used by the CC backend.

If an input file contains more than one module, C generates one .h file per module if either /C_DEVELOPMENT or /VMS_DEVELOPMENT is specified and one file containing all the modules otherwise.

C defines a macro with all lowercase characters to equal the same name in all uppercase characters for every entry node if either /C_DEVELOPMENT or /VMS_DEVELOPMENT is specified.

C creates function prototypes if either /C_DEVELOPMENT or /VMS_DEVELOPMENT is specified (although the ones generated with /VMS_DEVELOPMENT only contain "__unknown_params").

C generates most definitions twice if /C_DEVELOPMENT is specified, separated with "#ifdef __NEW_STARLET" ... "else" ... "endif". The "__NEW_STARLET" definitions contain complete function prototypes, the "OLD" definitions only "__unknown_params". Also the definitions of structs and unions are different.

The __member_alignment pragmas are only generated if both /ALPHA_AXP and /C_DEVELOPMENT are specified.

C generates "if !defined(__VAXC)" for special cases if /C_DEVELOPMENT or /VMS_DEVELOPMENT is specified, otherwise "ifdef __cplusplus" is generated.

C generates "#ifndef __<module-name>_LOADED" ... if /C_DEVELOPMENT or /VMS_DEVELOPMENT is specified.

C generates "__required_pointer_size" pragmas if either /VMS_DEVELOPMENT or both /V_DEVELOPMENT and /ALPHA_AXP are specified.

Together with the /ALPHA_AXP qualifier and the /VMS_DEVELOPMENT qualifier this qualifier influences the definition of certain data types and the generation of certain pragmas, e.g. the data type QUADWORD is defined as __int64 if /ALPHA_AXP is specified and /VMS_DEVELOPMENT and not /C_DEVELOPMENT, and as int [2] otherwise, and the HARDWARE_ADDRESS and POINTER_HW data types are defined as __int64 if /ALPHA_AXP and neither /C_DEVELOPMENT nor /VMS_DEVELOPMENT are specified and as int[2] if /ALPHA_AXP is not specified, and are not defined if /ALPHA_AXP and one of the qualifiers /C_DEVELOPMENT or /VMS_DEVELOPMENT is specified.

/[NO]DUMP [=file-spec]

Controls whether the HP SDL intermediate code is displayed on your screen. If you specify the /DUMP qualifier with a file specification, the output is sent to the specified file. The default is /NODUMP.

/[NO]GLOBAL_DEFINITION

Controls whether an item or aggregate declared with the GLOBAL option generates a declaration indicating that the value of the global data item is defined in this module. In some languages, this qualifier has no effect; see the individual language translation summaries in Appendix B and online examples of language output files as a result of processing the HP SDL source file EXAMPLE.SDL in SDL$EXAMPLES.

By default, global definitions are not generated; the GLOBAL option designates global data whose value is defined elsewhere.

/[NO]HEADER

Controls whether a header containing the date and the source file name is included at the beginning of the output file. The default is /HEADER.

/LANGUAGES={language[=file-spec]}
{(language[=file-spec],...)}

Specifies one or more of the language options listed in Table 2-2 for which the HP SDL translator is to produce one or more source output files. By default, HP SDL writes output files into separate files in the current default directory. The default file name for each output file is taken from the file name of the corresponding source file and the default target file type for each language name.

Table 2-2 HP SDL Output Language Options and File Types
Language Option Target File Type
HP Ada /LANGUAGES =ADA .ADA
HP BASIC /LANGUAGES =BASIC .BAS
HP BLISS /LANGUAGES =BLISS .R32, .R64
  /LANGUAGES =BLISSF .R32, .R64 1
HP C/C++ /LANGUAGES =CC .H
HP OpenVMS DCL /LANGUAGES =DCL .COM
HP DATATRIEVE /LANGUAGES =DTR .DTR
HP FORTRAN /LANGUAGES =FORTRAN .FOR
HP MACRO /LANGUAGES =MACRO .MAR
HP Pascal /LANGUAGES =PASCAL .PAS
Kednos PL/I /LANGUAGES =PLI .PLI
SDML /LANGUAGES =SMDL .SDML
DECTPU /LANGUAGES =TPU .TPU
UIL /LANGUAGES =UIL .UIL


1The BLISSF back end generates HP BLISS FIELDSETS for HP SDL aggregates.

HP SDL builds the language image name by concatenating the prefix SDL to the language option specified on the SDL command. For example, if you specify /LANGUAGE=FORTRAN, HP SDL searches for and activates the SDL$FORTRAN.EXE back end. You may abbreviate most language options, but HP SDL uses the first image it finds that matches the generated file specification. For example, if you wish to invoke the BLISSF back end instead of the HP BLISS back end, you must specify /LANGUAGE=BLISSF.

The /LANGUAGE qualifier also allows you to override the default output file specification for one or more language output files. You can specify a language option followed by the destination file specification for that language. You must separate the language from the destination file specification with an equal sign (=) and separate specifications for different languages with commas.

/[NO]LIST

Controls whether a listing file is produced.

If the SDL command is executed from interactive mode, /NOLIST is the default. If the SDL command is executed from batch mode, /LIST is the default.

The /LIST qualifier causes the HP SDL translator to produce a listing file with numbered lines of source code and descriptions of any compilation errors. The listing file has the same name as the related source file and a file type of .LIS.

/[NO]MEMBER_ALIGN

Specifies that every item in aggregates should be aligned. This is the same as specifying ALIGN on all aggregates.

/[NO]MODULE

Controls whether a HP Ada package or a HP Pascal module is generated in the output file. The default is /MODULE. The /[NO]MODULE qualifier affects only the HP Pascal and HP Ada languages.

/[NO]PARSE [=file-spec]

Controls whether HP SDL reads or writes a HP SDL intermediate file. A HP SDL intermediate file contains HP SDL source code that has already been parsed using the SDL/PARSE command. The default file type for the HP SDL intermediate file is .SDI.

The intermediate file produced as a result of the SDL/PARSE command can later be used instead of HP SDL source code as input to the back end. This is done using the SDL/NOPARSE command. When this command appears in an SDL command line, the input file specification is assumed to be that of an SDL intermediate file with a default file type of .SDI. Examples 4 and 5 at the end of this section show the uses of the /[NO]PARSE qualifiers.

/[NO]PLI_DEVELOPMENT

Only used by the PLI backend.

This qualifier specifies the definition of certain data types, e.g. most integral data types are defined as fixed binary (n) if /PLI_DEVELOPMENT is specified and as bit(n) aligned otherwise.

In addition to that, the type names of certain parameters are changed, e.g. "ASTADR" to "entry value" and "MASK_BYTE" to "bit (8) aligned".

Default parameters that are not optional are marked as "optional" if /PLI_DEVELOPMENT is specified

/[NO]SUBFIELDS

When this qualifier is given, the BLISSF backend handle subfields of members declared with a named type differently.

/SUPPRESS ={suppress-option}
{(suppress-option,...)}

The /SUPPRESS qualifier has the following format:


    SDL /SUPPRESS=(PREFIXES, TAGS) 

Note the following:

/SYMBOLS={symbol=value}
{(symbol=value,...)}

It is possible to specify symbols and values which can be used in the IFSYMBOL statement (kind of conditional compilation).

See IFSYMBOL.

/VAX

For modules, FORTRAN writes the following comment to the output file:
!DEC$ OPTIONS/ALIGN=(RECORDS=PACKED,COMMONS=PACKED)/NOWARN

CC generates "double" as return type for functions if the actual return type is quadword and /VAX but not /VMS_DEVELOPMENT is specified.

You cannot specify the qualifiers /ALPHA_AXP and /VAX together. You cannot specify the qualifiers /B64 and /VAX together.

/[NO]VMS_DEVELOPMENT

Modifies the behavior of certain HP SDL back ends so that the generated output files conform to specific VMS development standards.

HP Ada defines the data types QUADWORD and INTEGER_QUAD as INTEGER_64 if /ALPHA_AXP and /VMS_DEVELOPMENT is specified and as UNSIGEND_QUADWORD otherwise.

For HP BLISS and BLISSF, the /VMS_DEVELOPMENT qualifier causes ENTRY declarations to call KEYWORD macros into the output (.R32) file and defines routines as "external routine routine-name : novalue" otherwise.

BLISS' and BLISSF's generation of certain "literal"s for the sizes of structures or unions depends on this qualifier.

The following rules apply when the /VMS_DEVELOPMENT qualifier is specified for HP BLISSF output:

CC handles user fill depending on /VMS_DEVELOPMENT.

CC handles references to aggregates within typedef'd aggregates different when /VMS_DEVELOPMENT is specified.

For HP MACRO, the /VMS_DEVELOPMENT qualifier causes the VMS macros $EQU, $DEF, $DEFINI, and $DEFEND to be called into the output (.MAR) file.

For HP Pascal, the /VMS_DEVELOPMENT qualifier causes "$TYPE" to be appended to the names of structures and unions in the output (.PAS) file.

The following rules apply when the /VMS_DEVELOPMENT qualifier is specified for HP Pascal output:

The following rules apply when the /VMS_DEVELOPMENT qualifier is specified for Kednos PL/I output:

The default is /NOVMS_DEVELOPMENT.

Examples

The following are examples and descriptions of the SDL command.


1. $ SDL BLOCKNODE/LANGUAGE= (PLI=PLI$:[PL1.PSRC],CC=C$:[C.CSRC])

HP SDL translates the declarations in BLOCKNODE.SDL to Kednos PL/I and HP C, writes the Kednos PL/I output to PLI$:[PL1.PSRC]BLOCKNODE.PLI, and writes the HP C output to C$:[C.CSRC]BLOCKNODE.H.


2. $ SDL VTREE.SRC/LANGUAGE=(PLI=[PLI.PSRC])

HP SDL translates the declarations in VTREE.SRC and writes the Kednos PL/I output to [PLI.PSRC]VTREE.PLI.


3. $ SDL/LANGUAGE=(MACRO,BLISS) IODEF,SSDEF

HP SDL translates the declarations in IODEF.SDL and SSDEF.SDL and writes the output to IODEF.MAR, IODEF.R32, SSDEF.MAR, and SSDEF.R32.


4. $ SDL/PARSE=INTER TEST

HP SDL translates the declarations in the source file TEST.SDL and writes the output to a HP SDL intermediate file called INTER.SDI.


5. $ SDL/NOPARSE/LANG=(MACRO,BLISS) INTER

HP SDL translates the declarations that have already been parsed by the HP SDL front end in INTER.SDI and writes the output to INTER.MAR and INTER.R32.


Previous Next Contents Index