VAX SDL (Structure Definition Language) Revision/Update Information: supersede information in the ___ _________ __________ VAX Structure Definition ________ ructure Definition Language document is intended for internal DIGITAL distribution only. l DIGITAL distribution only. Operating System and Version: Operating System and Version: VAX/VMS Version 4.0 or later Software Version: Software Version: VAX SDL V3.0 Revised, June 1985 Revised, June 1985 and should not be construed as a commitment by Digital Equipment Corporation. Digital Equipment Corporation assumes no responsibility for any errors that may appear in this document. s no responsibility for any errors that may appear in this document. and may be used or copied only in accordance with the terms of such license. be used or copied only in accordance with the terms of such license. equipment that is not supplied by Digital Equipment Corporation or its affiliated companies. upplied by Digital Equipment Corporation or its affiliated companies. All Rights Reserved. ment Corporation All Rights Reserved. Printed in U.S.A. requests the user's critical evaluation to assist in preparing future documentation. er's critical evaluation to assist in preparing future documentation. The following are trademarks of Digital Equipment Corporation: DEC/CMS EduSystem UNIBU DEC/MMS IAS VAX S DECnet MASSBUS VMS DECsystem-10 PDP VT DECSYSTEM-20 PDT DECUS RSTS DECwriter DECwriter CONTENTS 2 CONVENTIONS USED IN THIS DOCUMENT . . . . . . . . iv 2 CONVENTIONS USED IN THIS DOCUMENT . . . . . . . . iv CHAPTER 1 OVERVIEW 1.1 OVERVIEW . . . . . . . . . . . . . . . . . . . . . 1-1 CHAPTER 2 USING SDL 2.1.1 SDL Source Language Syntax . . . . . . . . . . . 2-1 2.1.1.1 Valid Names . . . . . . . . . . . . . . . . . . 2-1 2.1.1.2 Keywords . . . . . . . . . . . . . . . . . . . . 2-3 2.1.1.3 Expressions . . . . . . . . . . . . . . . . . . 2-3 2.1.1.4 Output Comments . . . . . . . . . . . . . . . . 2-4 2.1.1.5 Local Comments . . . . . . . . . . . . . . . . . 2-4 2.1.1.6 INCLUDE statement . . . . . . . . . . . . . . . 2-4 2.1.2 SDL Data Types . . . . . . . . . . . . . . . . . 2-4 2.1.2.1 Integer Data Type Keywords . . . . . . . . . . . 2-5 2.1.2.2 Floating-Point Data Type Keywords . . . . . . . 2-5 2.1.2.3 Packed Decimal Data Type Keyword . . . . . . . . 2-5 2.1.2.4 Bit-String Data Type Keyword . . . . . . . . . . 2-5 2.1.2.5 Boolean Data Type Keyword . . . . . . . . . . . 2-6 2.1.2.6 Character-String Data Type Keyword . . . . . . . 2-6 2.1.2.7 Address and Pointer Data Type Keyword . . . . . 2-6 2.1.2.8 User specified TYPE name . . . . . . . . . . . . 2-7 2.1.3 Declarations . . . . . . . . . . . . . . . . . . 2-8 2.1.3.1 MODULE Declarations . . . . . . . . . . . . . . 2-8 2.1.3.2 Local Symbol Declarations . . . . . . . . . . . 2-8 2.1.3.3 CONSTANT Declarations . . . . . . . . . . . . . 2-8 2.1.3.4 AGGREGATE Declarations . . . . . . . . . . . . 2-10 2.1.3.4.1 Subaggregate Declarations . . . . . . . . . . 2-12 2.1.3.4.2 Data Alignment and Offsets Within Aggregates . 2-12 2.1.3.5 Specifying the Size of an Aggregate . . . . . 2-14 2.1.3.6 Forcing Negative Offsets . . . . . . . . . . . 2-14 2.1.3.7 ITEM Declarations . . . . . . . . . . . . . . 2-15 2.1.3.8 ENTRY Declarations . . . . . . . . . . . . . . 2-15 2.1.4 Storage Classes . . . . . . . . . . . . . . . 2-16 2.1.5 Dimensions . . . . . . . . . . . . . . . . . . 2-17 2.1.6 Prefixes and Tags . . . . . . . . . . . . . . 2-18 2.1.6 Prefixes and Tags . . . . . . . . . . . . . . 2-18 CHAPTER 3 SDL LANGUAGE AND COMMAND REFERENCE 3.1.1 The SDL Command . . . . . . . . . . . . . . . . 3-2 3.1.2 Syntax Rules . . . . . . . . . . . . . . . . . . 3-6 3.1.2.1 Names . . . . . . . . . . . . . . . . . . . . . 3-6 3.1.2.1.1 Expressions . . . . . . . . . . . . . . . . . . 3-6 3.1.2.1.2 Operators . . . . . . . . . . . . . . . . . . . 3-7 3.1.2.2 Output Comments . . . . . . . . . . . . . . . . 3-7 3.1.2.2 Output Comments . . . . . . . . . . . . . . . . 3-7 3 3.1.3 Declarations . . . . . . . . . . . . . . . . . . 3-8 3.1.3.1 MODULE Declarations . . . . . . . . . . . . . . 3-8 3.1.3.2 Local Symbol Declarations . . . . . . . . . . . 3-9 3.1.3.3 CONSTANT Declarations . . . . . . . . . . . . . 3-9 3.1.3.4 AGGREGATE Declarations . . . . . . . . . . . . 3-11 3.1.3.4.1 STRUCTURE Declarations . . . . . . . . . . . . 3-13 3.1.3.4.2 UNION Declarations . . . . . . . . . . . . . . 3-13 3.1.3.5 Member Declarations . . . . . . . . . . . . . 3-14 3.1.3.6 Implicit Union Declarations . . . . . . . . . 3-15 3.1.3.6.1 DIMENSION with Implicit Union . . . . . . . . 3-16 3.1.3.7 ITEM Declarations . . . . . . . . . . . . . . 3-17 3.1.3.8 ENTRY Declarations . . . . . . . . . . . . . . 3-18 3.1.4 Data Types . . . . . . . . . . . . . . . . . . 3-21 3.1.5 Storage Classes . . . . . . . . . . . . . . . 3-23 3.1.6 Dimensions . . . . . . . . . . . . . . . . . . 3-24 3.1.7 Prefixes and Tags . . . . . . . . . . . . . . 3-24 3.1.7.1 Prefixes . . . . . . . . . . . . . . . . . . . 3-24 3.1.7.2 Tags . . . . . . . . . . . . . . . . . . . . . 3-25 3.1.8 Translation Summaries . . . . . . . . . . . . 3-27 3.1.8.1 BLISS-32 Translation Summary . . . . . . . . . 3-28 3.1.8.2 C Translation Summary . . . . . . . . . . . . 3-30 3.1.8.3 FORTRAN Translation Summary . . . . . . . . . 3-32 3.1.8.4 MACRO-32 . . . . . . . . . . . . . . . . . . . 3-34 3.1.8.5 PL/I Translation Summary . . . . . . . . . . . 3-37 3.1.8.6 PASCAL Translation Summary . . . . . . . . . . 3-39 3.1.8.7 DATATRIEVE Translation Summary . . . . . . . . 3-42 3.1.8.8 EPASCAL Translation Summary . . . . . . . . . 3-45 3.1.8.9 ADA Translation Summary . . . . . . . . . . . 3-51 3.1.8.9 ADA Translation Summary . . . . . . . . . . . 3-51 CHAPTER 4 EXAMPLES 4.1.1 SDL Source File Listing . . . . . . . . . . . . 4-1 4.1.2 BLISS-32 (BLISSF) Output . . . . . . . . . . . . 4-5 4.1.3 C Output . . . . . . . . . . . . . . . . . . . . 4-8 4.1.4 FORTRAN Output . . . . . . . . . . . . . . . . 4-11 4.1.5 MACRO-32 Output . . . . . . . . . . . . . . . 4-14 4.1.6 PL/I Output . . . . . . . . . . . . . . . . . 4-17 4.1.7 PASCAL Output . . . . . . . . . . . . . . . . 4-20 4.1.8 DATATRIEVE Output . . . . . . . . . . . . . . 4-24 4.1.9 ELN Pascal Output . . . . . . . . . . . . . . 4-27 4.1.10 Ada Output . . . . . . . . . . . . . . . . . . 4-30 4.1.10 Ada Output . . . . . . . . . . . . . . . . . . 4-30 APPENDIX A SUMMARY OF SDL KEYWORDS APPENDIX B SDL ERROR MESSAGES AND ERROR CONDITIONS 4 APPENDIX C GENERATING SDL OUTPUT FOR OTHER LANGUAGES C.1.1 The SDL$PUTLINE Routine . . . . . . . . . . . . C-2 C.1.2 Writing a Source File Header . . . . . . . . . . C-2 C.1.3 Error Message Output . . . . . . . . . . . . . . C-3 C.2 BUILDING A NEW SDL BACK END . . . . . . . . . . . C-3 C.3 THE SDL TREE . . . . . . . . . . . . . . . . . . . C-4 C.3.1 General Format of Tree Nodes . . . . . . . . . . C-7 C.3.2 Node Types and Definitions . . . . . . . . . . C-10 C.3.2.1 ROOT Nodes . . . . . . . . . . . . . . . . . . C-10 C.3.2.2 Comment Node . . . . . . . . . . . . . . . . . C-10 C.3.2.3 Constant Nodes . . . . . . . . . . . . . . . . C-10 C.3.2.4 Entry Nodes . . . . . . . . . . . . . . . . . C-11 C.3.2.5 Item Nodes . . . . . . . . . . . . . . . . . . C-11 C.3.2.6 Module Nodes . . . . . . . . . . . . . . . . . C-13 C.3.2.7 Parameter Nodes . . . . . . . . . . . . . . . C-13 C.3.2.8 Object Nodes . . . . . . . . . . . . . . . . . C-14 C.3.2.9 Head Nodes . . . . . . . . . . . . . . . . . . C-15 C.3.3 Data Type Information . . . . . . . . . . . . C-15 C.3.3.1 Integers . . . . . . . . . . . . . . . . . . . C-15 C.3.3.2 Character Strings . . . . . . . . . . . . . . C-16 C.3.3.3 Packed Decimal . . . . . . . . . . . . . . . . C-16 C.3.3.4 Bit Fields . . . . . . . . . . . . . . . . . . C-16 C.3.3.5 Boolean Data . . . . . . . . . . . . . . . . . C-16 C.3.3.6 Address Data . . . . . . . . . . . . . . . . . C-16 C.3.3.7 Structure Aggregates . . . . . . . . . . . . . C-17 C.3.3.8 Union Aggregates . . . . . . . . . . . . . . . C-17 C.3.3.9 Parameter Passing Attributes . . . . . . . . . C-17 C.4 SOURCES . . . . . . . . . . . . . . . . . . . . C-18 C.4.1 The PL/I Output Routine . . . . . . . . . . . C-19 C.4.1 The PL/I Output Routine . . . . . . . . . . . C-19 5 PREFACE PREFACE translator that transforms data definitions into statements of one or more target VAX source languages. SDL is suitable for systems and application programming environments where an executable program consists of modules written in two or more programming languages. ram consists of modules written in two or more programming languages. INTENDED AUDIENCE INTENDED AUDIENCE languages and are currently involved in multilanguage programming applications. This document is not a tutorial. ilanguage programming applications. This document is not a tutorial. STRUCTURE OF THIS DOCUMENT STRUCTURE OF THIS DOCUMENT This manual consists of the following chapters and appendixes: in SDL. contains a brief overview of the features available in SDL. sample SDL input lines and resulting output. rations, showing sample SDL input lines and resulting output. SDL declarations and options. n that defines the syntax of SDL declarations and options. output files produced for the supported languages. t file and output files produced for the supported languages. o Appendix A summarizes SDL keywords. produce output for additional target languages. ding SDL to produce output for additional target languages. iii PREFACE PREFACE generate output for additional target languages. a routine to generate output for additional target languages. additional language output may be incorporated easily. The Translation Summaries at the end of Chapter 3 describe the output generated for individual target languages. 3 describe the output generated for individual target languages. target languages using a representative source file. for individual target languages using a representative source file. any interested groups within DIGITAL. To request a copy of the SDL software, to report problems, or to obtain the source files necessary to generate an output routine for another language, contact the Technical Languages Development Group, ZK2-3/N30. nguage, contact the Technical Languages Development Group, ZK2-3/N30. CONVENTIONS USED IN THIS DOCUMENT CONVENTIONS USED IN THIS DOCUMENT The following conventions are used in this document: Convention Meaning Convention Meaning { UNION } one of the items must be selected. cate a choice; { UNION } one of the items must be selected. item(s) are optional. indicate that the enclosed item(s) are optional. [ GLOBAL ] choice; only one may be selected. cate an optional [ GLOBAL ] choice; only one may be selected. format descriptions are SDL keywords, which must be specified as shown in SDL files. Names and syntactic elements shown in lowercase letters represent user-specified names and identifiers. ers represent user-specified names and identifiers. preceding item may be repeated one or more times, with commas separating two or more items. ore times, with commas separating two or more items. iv CHAPTER 1 CHAPTER 1 OVERVIEW OVERVIEW language-independent data definiton language. Data structures declared in SDL can be translated into source statements of one or more VAX languages. The resulting language source files can then be subsequently compiled or assembled and linked. urce files can then be subsequently compiled or assembled and linked. data structure. Thus, the source files for any multilanguage implementation can be more easily maintained since only one version of each data structure need be modified. ained since only one version of each data structure need be modified. following languages: f SDL is distributed with support for the following languages: o VAX Ada o VAX BLISS o VAX C o VAX DATATRIEVE o VAX FORTRAN o VAX MACRO o VAX PASCAL o VAX PL/I o ELN Pascal for building new language-specific modules to output source statements for additional languages. pecific modules to output source statements for additional languages. 1-1 OVERVIEW OVERVIEW are of the form "SDL{language}.EXE," where {language} is any string of characters representing the language. For example: is any string of characters representing the language. For example: SDLPLI.EXE is the PL/I image. . SDLCC.EXE is the C image. . SDLCC.EXE is the C image. SDL translates declarations of: o Data structures o Scalar items o Named constants o External entries that can (or need) be expressed in that language. Figure 1- shows the relationship of the SDL translator to its input and output files. Examples 1 and 2 show a representative SDL source file and its PL/I output with notes that highlight some of SDL's features. ts PL/I output with notes that highlight some of SDL's features. 1-2 OVERVIEW OVERVIEW Example 1: Sample SDL Source File Example 1: Sample SDL Source File MODULE opr_descriptor; /* define constants and node structure for operators #max_args = 10; EQUALS 1 INCREMENT 1; typed) EQUALS 1 INCREMENT 1; flink ADDRESS; TURE PREFIX "opr_"; blink ADDRESS; ESS; opcount WO optype CHARACTE id WORD; RACTER LENGTH 1; flags STRU is_constant_size BI is_terminator BITFIELD LENGTH 1; ; context BITFIELD LENGTH 3; H 1; filler BITFIELD LENGTH 8-^; END; BITFIELD LENGTH 8-^; #opsize = .; operands LONGWO END; ds LONGWORD DIMENSION 0:#max_args-1; END; CONSTANT opr_node_size EQUALS #opsize / 2; ITEM current_node_ptr ADDRESS GLOBAL; END_MODULE; The following rules apply to Examples 1 and 2: 1. All SDL declarations are grouped within modules. throughout a source file, and may be used to express values #max_args xpress values in declarations. Note how the symbol #max_args operands #max_args is used in the declaration of the array operands, the declaration of the array operands, below. constants. When an increment value is specified, SDL automatically increments the initial value for each declaration in the list. the initial value for each declaration in the list. members. declarations define data structures and their members. for the target language output file(s) by concatenating the prefix and a data type code to the declared member names. prefix and a data type code to the declared member names. 1-3 OVERVIEW OVERVIEW Example 2. se declarations with the PL/I output shown in Example 2. Example 2: The PL/I Output for the Sample SDL Source File Example 2: The PL/I Output for the Sample SDL Source File /** /* define constants and node stru */ efine constants and node structure for operators %REP %REPLACE floating BY 2; 1; %REPLACE char BY 3; 2; %REPLACE untyped BY 4 PLACE untyped BY 4; %RE DCL 1 operator BASED , Y 54; 2 opr_a_flink pointe 2 opr_a_blink pointer, 2 opr_w_opcount fixed bi 2 opr_t_optype character(1), 5), 2 opr_w_id fixed binary(15), 2 opr_b_flags, binary(15), 3 opr_v_is_cons 3 opr_v_is_terminator bit(1), , 3 opr_v_context bit(3), (1), 3 opr_v_filler bit(3), 2 opr_l_operands (0:9) fi %REPLACE opr_node_size BY 7; xed binary(31); DCL current_node_ptr pointer G DCL current_node_ptr pointer GLOBALREF ; attributes specified by SDL keywords. ared with data type attributes specified by SDL keywords. offset from the most recently declared subaggregate. Here, filler ently declared subaggregate. Here, the declaration of filler boundary. tion of filler pads the bit structure to a byte boundary. within the AGGREGATE declaration. This local symbol declaration captures the size of the constant portion of the operator the size of the constant portion of the structure operator. opr_node_size ue is used in the declaration of the constant opr_node_size. declaration of the constant opr_node_size. operands r scalar can have a dimension. This array named operands named operands has 10 elements, with subscripts 0 through 9. current_node_ptr declaration such as this declaration of current_node_ptr defines a scalar item. his declaration of current_node_ptr defines a scalar item. 1-4 OVERVIEW OVERVIEW aggregate to override the default storage class, the interpretation of which is language specific. e class, the interpretation of which is language specific. 1-5 CHAPTER 2 CHAPTER 2 USING SDL USING SDL This chapter provides a functional description of SDL, with examples. Modules group declarations of related identifiers and structures. They may correspond to assembly language MACRO-32 definition files or higher-level language INCLUDE files. ge MACRO-32 definition files or higher-level language INCLUDE files. summarizes, for each declaration, the SDL attributes and options that can be applied. You can enter declarations in a module in any order, as long as a given declaration precedes any references to it. order, as long as a given declaration precedes any references to it. 2.1 SOURCE LANGUAGE SYNTAX 2.1 SOURCE LANGUAGE SYNTAX user-specified identifiers, and expressions, which are terminated by a semicolon. Spaces or tabs delimit these elements in a declaration. a semicolon. Spaces or tabs delimit these elements in a declaration. 2.1.1 Valid Names 2.1.1 Valid Names symbol names. Names can consist of any of the characters A through Z, a through z, 0 through 9, dollar sign ($) and underscore (_). All source program identifiers must begin with an alphabetic letter, a dollar sign, or an underscore. Local symbol names must begin with a number sign (#), which is not otherwise valid in SDL names. with a number sign (#), which is not otherwise valid in SDL names. the target language back ends, with the addition of SDL-generated prefixes, if specified in the declaration. For example, if you enter an identifier in lowercase letters, it is passed through to the target language source files in lowercase letters. Because of this feature, SDL is also case sensitive with respect to identifiers. If an SDL SDL is also case sensitive with respect to identifiers. If an SDL 2-1 USING SDL USING SDL a case-sensitive match. You can enclose a name in quotation marks if you need to use characters that are not valid in SDL identifiers. if you need to use characters that are not valid in SDL identifiers. Table 2-1: Attributes and Options for SDL Declarations Table 2-1: Attributes and Options for SDL Declarations ------------------------------ Data Storage Pref Type Class Dimension Tag x/ Attributes Option Option Optio Attributes Option Option Options Valid Declarations MODULE declaration ; /*comment no no no no local name declaration ; no no no no CONSTANT declaration ; no no yes yes AGGREGATE declaration ; yes yes yes yes . ber declaration ; yes no yes yes . . sub member ; yes yes yes yes . ber . . END . END; . . END END; ITEM declaration yes yes yes yes ENTRY declaration no no no no END_MODULE; are equivalent. For example, #ABC and #abc refer to the same local symbol. valent. For example, #ABC and #abc refer to the same local symbol. 2-2 USING SDL USING SDL 2.1.2 Keywords 2.1.2 Keywords uppercase or lowercase, but cannot be truncated. Keywords are not allowed as program identifiers unless they are enclosed in quotation marks. For example: ntifiers unless they are enclosed in quotation marks. For example: ITEM "length" LONGWORD; This declaration produces the source program identifier length. Appendix A summarizes SDL keywords. rce program identifier length. Appendix A summarizes SDL keywords. 2.1.3 Expressions 2.1.3 Expressions Valid SDL expressions can consist of any of the following: hexadecimal, octal, binary, or ASCII notation. SDL treats decimal constants as signed longwords. Decimal is the default unless one of the radix specifiers %X, %O, or %B indicates a hexadecimal, octal, or binary constant, respectively. %A indicates an integer with the ASCII value of the character that follows it. eger with the ASCII value of the character that follows it. constants or SDL local symbols and declared constants with integer values: L local symbols and declared constants with integer values: * and / + and - @ (logica ! (logical OR) ) & (logical AND) & (logical AND) integer longword values. ared output constants, which have integer longword values. representing the current byte offset from the origin in an AGGREGATE declaration; the colon (:), representing the current byte offset relative to the first member in an aggregate declaration; and the circumflex (^), representing the bit offset from the most recent byte-aligned element. These symbols are described more fully in Section 2.3.4.2. . These symbols are described more fully in Section 2.3.4.2. evaluation. Expressions within the innermost set of parentheses are evaluated first. n the innermost set of parentheses are evaluated first. 2-3 USING SDL USING SDL 2.1.4 Output Comments 2.1.4 Output Comments line, is considered an output comment. air /*, up to the end of the line, is considered an output comment. target language source file as separate comment lines. Comments appearing at the end of a line will be output at the end of the corresponding target source line, if possible. at the end of the corresponding target source line, if possible. 2.1.5 Local Comments 2.1.5 Local Comments is considered a comment that is local to the SDL source file and is not output in the target language source file. Local comments may appear anyplace in the source file where white space is allowed. may appear anyplace in the source file where white space is allowed. 2.1.6 INCLUDE Statement 2.1.6 INCLUDE Statement incorporated in the SDL translation directly following the INCLUDE statement. The statement has the form: irectly following the INCLUDE statement. The statement has the form: INCLUDE "file-spec"; statement cannot appear embedded within an AGGREGATE. Aside from the aggregate restriction, an INCLUDE statement can appear anywhere else within the module. If a directory is not included in the file-specification, the current default directory is used. d in the file-specification, the current default directory is used. current file and reads the statements in the included file. When it reaches the end of the included file, SDL resumes translation with the next declaration after the INCLUDE statement. es translation with the next declaration after the INCLUDE statement. 2.2 DATA TYPES 2.2 DATA TYPES be declared as members of aggregates or as individual items. The data type declaration also specifies, either implicitly or explicitly, the size of a member. so specifies, either implicitly or explicitly, the size of a member. to specify them. The translation tables in the SDL Language Reference show the SDL translations of each data type in a given target source language. L translations of each data type in a given target source language. 2-4 USING SDL USING SDL 2.2.1 Integer Data Type Keywords 2.2.1 Integer Data Type Keywords declare storage units of 8, 16, 32, 64, and 128 bits, respectively, to represent signed integer data. Any of these data types may also specify the keyword UNSIGNED to indicate unsigned integer data. also specify the keyword UNSIGNED to indicate unsigned integer data. 2.2.2 Floating-Point Data Type Keywords 2.2.2 Floating-Point Data Type Keywords H_FLOATING declare storage units for single-, double-, G-, and H-floating-point data, respectively. or single-, double-, G-, and H-floating-point data, respectively. 2.2.3 Packed Decimal Data Type Keyword 2.2.3 Packed Decimal Data Type Keyword specifies the size of the item, as in this example: al data item and specifies the size of the item, as in this example: ITEM percentage DECIMAL PRECISION (3,2); consisting of three decimal digits, two of which are fractional. alue consisting of three decimal digits, two of which are fractional. 2.2.4 Bit-String Data Type Keyword 2.2.4 Bit-String Data Type Keyword variables must be members of aggregates. You can specify the LENGTH option to override the default length of 1. For example: the LENGTH option to override the default length of 1. For example: data_type BITFIELD LENGTH 3 is_variable BITFIELD; TH 3; END; iable BITFIELD; END; This example illustrates a structure with two bit field declarations. variable and a constant bit mask for the variable. For example: ield variable and a constant bit mask for the variable. For example: resolved BITFIELD MASK; IX tst$; psv BITFIELD MASK; SK; mark1 BITFIELD MASK; spare_bits BITFIELD LE END; bits BITFIELD LENGTH 5; END; 2-5 USING SDL USING SDL The declaration of resolved declarations in the output file: a declaration for the bit field itself and a declaration of a constant mask whose value is 1. Since the PREFIX option is specified for this aggregate, the identifiers tst$v_resolved tst$m_resolved produced for this declaration are tst$v_resolved and tst$m_resolved, where the tag "v_" indicates the bit field variable and the tag "m_" indicates the mask. Prefixes and tags are described in more detail in Section 2.6. mask. Prefixes and tags are described in more detail in Section 2.6. 2.2.5 Boolean Data Type Keyword 2.2.5 Boolean Data Type Keyword field that can have one of two values, 0 or 1. . This is a one-byte field that can have one of two values, 0 or 1. For example: ITEM true BOOLEAN; This declaration produces a Boolean variable in target languages. 2.2.6 Character-String Data Type Keyword 2.2.6 Character-String Data Type Keyword length. You can specify the LENGTH option to override the default length of one character. For example: option to override the default length of one character. For example: message_text CHARACTER LENGTH 25 severity WORD; RACTER LENGTH 256; END; ty WORD; END; message_text te MSG_BUFFER contains a character-string member named message_text languages that support varying-length character strings, you can specify the VARYING keyword, as follows: haracter strings, you can specify the VARYING keyword, as follows: message_text CHARACTER LENGTH 256 VARYING; In this example, the member message_text characters. le, the member message_text has a maximum length of 256 characters. 2.2.7 Address and Pointer Data Type Keyword 2.2.7 Address and Pointer Data Type Keyword or pointer. For example: rd declares a data item that is an address, or pointer. For example: ITEM list_head ADDRESS; 2-6 USING SDL USING SDL This declaration specifies a pointer named list_head. This declaration specifies a pointer named list_head. to, you can specify the data type as follows: of the object pointed to, you can specify the data type as follows: size_address ADDRESS (LONGWORD); This declaration indicates a pointer to a longword. data types. is ignored for languages in which pointers are distinct data types. name of a previously defined SDL aggregate. For example: using the name of a previously defined SDL aggregate. For example: flink ADDRESS (any_node); blink ADDRESS (any_node); END; ADDRESS (any_node); END; In this example, the first two members of the structure any_node forward and backward pointers to similar nodes. Note that an aggregate that is the object of an ADDRESS declaration must have the default (based) storage class. an ADDRESS declaration must have the default (based) storage class. 2.2.8 User specified TYPE name 2.2.8 User specified TYPE name an SDL keyword. Depending on the language being generated, this name may or may not override the SDL keyword datatype. For example; name may or may not override the SDL keyword datatype. For example; CHARACTER DESCRIPTOR NAMED CTRSTR IN TY WORD UNSIGNED NAMED OUTLEN OUT DEFAULT 0 TYPENAME NUMBER, CHARACTER DESCRIPTOR NAMED OUTBUF OUT TYPENAME CHARDESC, LONGWORD VALUE NAMED P1 TYPENAME VARIES ENAME CHARDESC, ) VARIABLE RETURNS LONGWORD TYPENAME COND ) VARIABLE RETURNS LONGWORD TYPENAME CONDVALU; parameters have a user defined TYPENAME. The Ada language back end makes use of these types. See the Ada output example in Chapter 4 for an example of the TYPENAME usage. Ada output example in Chapter 4 for an example of the TYPENAME usage. 2.3 DECLARATIONS 2.3 DECLARATIONS The following sections describe MODULE declarations. 2-7 USING SDL USING SDL 2.3.1 MODULE Declarations 2.3.1 MODULE Declarations No declarations (other than comments) can occur outside of a module as defined by the limits of the MODULE and END_MODULE keywords. Local symbol assignments can occur outside of a module. keywords. Local symbol assignments can occur outside of a module. corresponds to the name of a MACRO. For example: ration; this name corresponds to the name of a MACRO. For example: MODULE $modef; $modef e beginning of the declaration for the macro or module named $modef. macro or module named $modef. a version number or other information to the target language source file. For example: r other information to the target language source file. For example: MODULE params IDENT "V2.0"; statement; this is particularly useful if you place more than one MODULE declaration in the same SDL source file. The module name is case-sensitive and must exactly match (in case) the name specified in the MODULE declaration. exactly match (in case) the name specified in the MODULE declaration. 2.3.2 Local Symbol Declarations 2.3.2 Local Symbol Declarations translatable into target source language statements. Local symbol names must begin with the # character. You can use any valid SDL expression to assign a signed integer longword value to a local symbol. Some examples of local symbol use are: ord value to a local symbol. Some examples of local symbol use are: #counter = #counte #counter = #counter + 1; Local symbol declarations can occur anywhere in the SDL source file. 2.3.3 CONSTANT Declarations 2.3.3 CONSTANT Declarations in the target language. It specifies a name or names and the constant values to be assigned to them. For example: r names and the constant values to be assigned to them. For example: CONSTANT block_node_size EQUALS 24; 2-8 USING SDL USING SDL This declaration creates the named constant block_node_size it the value of 24. tes the named constant block_node_size and gives it the value of 24. declarations. CONSTANT declarations and their computed values are translated to the target source language. The names and values of local symbols, on the other hand, are never passed directly through to the target source languages. The values of declared constants and local symbols are available for use in SDL expressions. For example, you could define the local symbol #block_size as follows: or example, you could define the local symbol #block_size as follows: #block_size = 24; Subsequent references to #block_size 24, as in this SDL declaration: ize result in the use of the value 24, as in this SDL declaration: CONSTANT block_node_size EQUALS #block_size; as follows: arations can also be specified in a comma-delimited list, as follows: xyz EQUALS alpha EQUALS 0, noname EQUALS 63; noname EQUALS 63; a CONSTANT declaration with the INCREMENT option. In this form, the EQUALS expression gives the value to be assigned to the first named constant; values for subsequent constants are derived by incrementing the first value by the specified increment and assigning the result to the next name in the list. For example: and assigning the result to the next name in the list. For example: bits bytes, words, longs, quads, octas ) EQUAL ) EQUALS 0 INCREMENT 1 PREFIX ctx$; assigned to all the names in a list. If there is no INCREMENT clause, then the increment value is 0; thus, the same initial value is assigned to all the names. If names are omitted from a comma-delimited list, SDL reserves the numbers that would be assigned to names in those positions. This lets you reserve numeric values for later assignment of names. For example: u reserve numeric values for later assignment of names. For example: (bad_bloc overlay,rewrite) EQUALS overlay,rewrite) EQUALS 0 INCREMENT 4; 2-9 USING SDL USING SDL In this example, SDL assigns the values 0 and 4 to the names bad_block bad_data e, SDL assigns the values 0 and 4 to the names bad_block and bad_data, overlay rewrite 16, and assigns the values 20 and 24 to the names overlay and rewrite. values 20 and 24 to the names overlay and rewrite. symbol for subsequent use. For example: value in a specified local symbol for subsequent use. For example: EQUALS 4 INCREMENT 4 PREFIX l COUNTER #lang; NT 4 PREFIX lang$ COUNTER #lang; EQUALS #lang + 4 INCREMENT 4 PR EQUALS #lang + 4 INCREMENT 4 PREFIX lang$; The constant names produced by these two declarations are: Constant Name Value Constant Name Value lang$k_c 8 lang$k_bliss 12 lang$k_macro 16 lang$k_basic 20 lang$k_pascal 24 lang$k_fortran 28 lang$k_fortran 28 list. For example: idual declarations in a CONSTANT declaration list. For example: pli, c, /* C I macro /* MAC ) EQUALS 4 INCREMENT ) EQUALS 4 INCREMENT 4 PREFIX lang$; 2.3.4 AGGREGATE Declarations 2.3.4 AGGREGATE Declarations The two types of aggregates, structures and unions, are declared using the keywords STRUCTURE and UNION, and differ as follows: clared using the keywords STRUCTURE and UNION, and differ as follows: each member has a unique offset from the beginning of the structure. has a unique offset from the beginning of the structure. overlaid; each one begins at the beginning of the union and thus has an offset of zero. Thus, a union lets you represent the same storage location using different names and different data types. rage location using different names and different data types. 2-10 USING SDL USING SDL delimit the end of the aggregate with an END delimiter as in the example below: d of the aggregate with an END delimiter as in the example below: type CHARACTER; size WORD; ER; next ADDRESS END dcb; SS; END dcb; aggregate name on the END (as shown in this example) is optional. If the aggregate name is used on the END statement, it must match the name used in the AGGREGATE declaration with respect to case. tch the name used in the AGGREGATE declaration with respect to case. of an aggregate can also contain local symbol declarations, CONSTANT declarations, and subaggregate declarations. l declarations, CONSTANT declarations, and subaggregate declarations. the default (based) storage class. n ADDRESS declaration must have the default (based) storage class. 2-11 USING SDL USING SDL 2.3.4.1 Subaggregate Declarations - 2.3.4.1 Subaggregate Declarations - keywords STRUCTURE or UNION, which represent the type of the subaggregate. Within an aggregate, subaggregates can be nested up to eight levels deep. n an aggregate, subaggregates can be nested up to eight levels deep. opcode WORD; node STRUCTURE; lang_bits UNIO pli_bits STRUCTUR resolved BITFIELD psv BITFIELD; LD; mark1 BITFIELD; spare_bits BITFIE END pli_bits; IELD LENGTH 5; c_bits STRUCTURE; value_variable_ psv BITFIELD; size BITFIELD; expanded BITFIE resolved BITFIELD; reduced BITFIELD; spare_bits BITFIELD END c_bits; TFIELD LENGTH 3; END lang_bits; END tree_node; END tree_node; In this example, the structures pli_bits and c_bits lang_bits lang_bits are both subaggregates of the union lang_bits. Since lang_bits c_bits pli_bits he union lang_bits. Since lang_bits is a union, c_bits and pli_bits c_bits and pli_bits occupy the same storage. 2.3.4.2 Data Alignment and Offsets Within Aggregates - 2.3.4.2 Data Alignment and Offsets Within Aggregates - boundaries. Thus, if an aggregate or subaggregate ends with bit field declarations that do not end on byte boundaries, SDL ensures that the next aggregate will begin on a byte boundary by supplying BITFIELD declarations as fillers if necessary. boundary by supplying BITFIELD declarations as fillers if necessary. string$v_fill_n string quired and provides a unique name of the form string$v_fill_n. string prefix supplied in the aggregate declaration, or the aggregate name if n aggregate name if no prefix was supplied. Within an aggregate, n incremented for each filler required. aggregate, n begins at 0 and is incremented for each filler required. section declare filler bit fields to force byte alignment at the end of each subaggregate; this programming practice makes it unnecessary for SDL to perform the alignment. ing practice makes it unnecessary for SDL to perform the alignment. 2-12 USING SDL USING SDL SDL provides three ways to refer to an offset within an aggregate: equal to the current byte offset from the origin of the AGGREGATE. If an ORIGIN attribute is present, the value of the period is equal to the byte offset from the member specified in the attribute. he byte offset from the member specified in the attribute. current byte offset in an AGGREGATE declaration. However, the value of the colon is always relative to the first member of the aggregate; that is, the value is not affected by the presence of an ORIGIN attribute. alue is not affected by the presence of an ORIGIN attribute. equal to the current bit offset relative to the most recently declared aggregate. bit offset relative to the most recently declared aggregate. and incremented by the bit lengths of each structure member in the aggregate at that level. Consider the following example: mber in the aggregate at that level. Consider the following example: . EGATE dcb STRUCTURE PREFIX dcb$; . . ufl context BITFIELD L local BITFIELD; LENGTH 3; END uflags; D; flags STRUCTUR extern BITFIELD; relo BITFIELD; END flags; D; END flags; are as follows: the bit offsets of the members of these structures are as follows: Member Bit Offset Member Bit Offset dcb$v_local 3 dcb$v_fill_0 4 dcb$v_extern 0 dcb$v_relo 1 dcb$v_fill_1 2 dcb$v_fill_1 2 Note that SDL has forced the structure flags boundary. DL has forced the structure flags to be aligned on a byte boundary. 2-13 USING SDL USING SDL 2.3.5 Specifying the Size of an Aggregate 2.3.5 Specifying the Size of an Aggregate the size of an aggregate or a portion of it. For example, in the declaration of a variable-length data structure, you can capture the size of the fixed-length portion, as shown in this example: ture the size of the fixed-length portion, as shown in this example: flink ADDRESS; STRUCTURE PREFIX opr_; blink ADDRESS; opcount WORD; optype CHARACTE id WORD; RACTER LENGTH 1; flags STRU is_constant_si is_terminator BITFIELD LENGTH 1; ; context BITFIELD LENGTH 3; H 1; filler BITFIELD LENGTH 8-^; END; BITFIELD LENGTH 8-^; #opsize = operands LONGWO END; ds LONGWORD DIMENSION(#max_args); END; CONSTANT node_size EQUALS #opsize / 2; Here, the local symbol #opsize operator set following the fixed-length portion of the structure operator. subsequently used in the CONSTANT declaration, which defines the size of the constant portion of the structure in words. defines the size of the constant portion of the structure in words. 2.3.6 Forcing Negative Offsets 2.3.6 Forcing Negative Offsets beginning of an aggregate with respect to another aggregate member. For example: an aggregate with respect to another aggregate member. For example: flink ADDRESS; TRUCTURE ORIGIN qflink; blink ADDRESS; qflink ADDRESS; qblink ADDRESS; END; ADDRESS; END; This declaration defines the origin of the structure nodes qflink flink blink structure nodes to be at the member qflink. Thus flink and blink qflink Thus flink and blink may be addressed as negative offsets from qflink. the values of the current bit and byte offset symbols (^ and :). These are always calculated as being relative to the beginning of the aggregate. ways calculated as being relative to the beginning of the aggregate. 2-14 USING SDL USING SDL 2.3.7 ITEM Declarations 2.3.7 ITEM Declarations arrays of scalar items that are not members of aggregates. For example: scalar items that are not members of aggregates. For example: ITEM block_list_id WORD; aggregate. tion specifies a word data item that is not a member of an aggregate. 2.3.8 ENTRY Declarations 2.3.8 ENTRY Declarations target language(s). Options let you specify: ion declaration in the target language(s). Options let you specify: that require parameters to be described). r those languages that require parameters to be described). o The return data type, if the entry represents a function. invoked with a variable number of parameters. point can be invoked with a variable number of parameters. named datatype that is not an SDL keyword. ier to supply a named datatype that is not an SDL keyword. For example: ENTRY random PARAMETER (LONGWORD) RETURNS LONGWORD; single longword parameter that returns a longword value. You can specify the following keywords on an ENTRY declaration to clarify how a parameter is to be passed: on an ENTRY declaration to clarify how a parameter is to be passed: be passed by immediate value. You must specify the data type of the parameter or the ANY keyword. st specify the data type of the parameter or the ANY keyword. any data type. If VALUE is not specified with ANY, the parameter is passed by reference. ot specified with ANY, the parameter is passed by reference. by descriptor. RIPTOR keyword when a parameter must be passed by descriptor. parameters. Both these keywords may be specified to indicate a parameter that is both an input and an output parameter. te a parameter that is both an input and an output parameter. 2-15 USING SDL USING SDL a name for the parameter. ollowed by an identifier to supply a name for the parameter. supply a named datatype that is not an SDL keyword. ifier to supply a named datatype that is not an SDL keyword. as follows: the system service SYS$GETJPI could be declared using SDL as follows: LONGWORD UNSIGNED VALUE NAMED EFN DEFAULT LONGWORD UNSIGNED NAMED PIDADR IN OUT DEFAULT 0 TYPENAME , PROCID, RD UNSIGNED NAMED PIDADR IN OUT DEFAULT 0 TYPENAME CHARAC PROCNAME, R DESCRIPTOR NAMED PRCNAM IN DEFAULT 0 TYPENAME ANY NAME QUADWORD UNSIGNED NAMED IOSB OUT DEFAULT ADDRESS(ENTRY) NAMED ASTADR DEFAULT 0 TYPENAME ASTADR, , LONGWORD UNSIGNED VALUE NAMED ASTPRM DEFAULT 0 TYPENAME USERPARM D UNSIGNED VALUE NAMED ASTPRM DEFAULT 0 TYPENAME ) RETUR ) RETURNS LONGWORD TYPENAME CONDVALU; 2.4 STORAGE CLASSES 2.4 STORAGE CLASSES for all scalar items and aggregates. The storage class refers to the manner in which the target compiler will allocate storage for the aggregate or item. The default storage class is based; that is, the scalar items and aggregates are defined so that they describe data for which storage is not allocated at compile time. The data description serves as a template for storage allocated dynamically at run time. For example, the MACRO-32 output routine places all declarations in an absolute program section by default and associates the names with the offset values. The PL/I output routine uses the BASED storage class attribute. es. The PL/I output routine uses the BASED storage class attribute. storage classes to override the default storage class: the following storage classes to override the default storage class: (Psect) with the OVR attribute and is shared by all routines that reference it. You declare data in common storage by using the COMMON option on an AGGREGATE or ITEM declaration. using the COMMON option on an AGGREGATE or ITEM declaration. whose value is defined elsewhere. You declare global data by using the GLOBAL option on an AGGREGATE or ITEM declaration. using the GLOBAL option on an AGGREGATE or ITEM declaration. command affects declarations of items and aggregates that specify the GLOBAL option. This qualifier causes SDL to specify the GLOBAL option. This qualifier causes SDL to 2-16 USING SDL USING SDL defined in this module. ndicating that a global value is defined in this module. each storage class in a given target source language. ranslations of each storage class in a given target source language. generate global definitions when an invocation of the macro is assembled. For example, suppose the SDL module $IODEF contains the following constant declarations: he SDL module $IODEF contains the following constant declarations: nop, T ( unload loadmcode seek, de, spacefi startmproc, recal, oc, stop, drvclr, initializ initialize) EQUALS 0 INCREMENT 1 PREFIX "io$"; definition, which may be invoked as follows: claration is a macro definition, which may be invoked as follows: $IODEF <==> constant definitions. To request that the locations of data fields be defined globally you add the argument <::> following the <==>. The MACRO-32 Translation Summary in Chapter 3 describes this usage in more detail. Translation Summary in Chapter 3 describes this usage in more detail. pointer-name option on an AGGREGATE declaration to bind a named pointer to that aggregate. In all target languages, the aggregate resulting from such a declaration has the default storage class (based). from such a declaration has the default storage class (based). 2.5 DIMENSIONS 2.5 DIMENSIONS dimensioned; that is, you can define an array of structures, a structure that contains one or more arrays, or an array of structures each of which contains one or more arrays. For example: structures each of which contains one or more arrays. For example: 2-17 USING SDL USING SDL bound STRUCTURE DIMENSION 8; lower LONGWORD; SION 8; upper LONGWORD; multiplier LONGWO constant_lower BITFIEL constant_upper BITFIELD LENGTH 1; constant_multiplier BITFIELD LENGTH reserved BITFIELD LENGTH 13; ENGTH 1; END bound; BITFIELD LENGTH 13; END array_info; END array_info; In this declaration, the subaggregate bound upper lower multiplier nts. Each element consists of the members upper, lower, multiplier, bound upper lower Since bound is an array, each of its members (upper, lower, multiplier d is an array, each of its members (upper, lower, multiplier, elements. and so on) can also be considered an array of eight elements. example above, the output routines assume that the value represents the high bound value and supply a default low bound value of one. You can override this default by specifying both a low bound and a high bound as follows: default by specifying both a low bound and a high bound as follows: ITEM node_pointers DIMENSION 0:255 ADDRESS; node_pointers ion results in the declaration of the array node_pointers, one dimension can be specified for an aggregate or item. This restriction ensures that there will be no interlanguage conflicts in an array declaration. hat there will be no interlanguage conflicts in an array declaration. array dimensions for other target source languages. L translations of array dimensions for other target source languages. 2.6 PREFIXES AND TAGS 2.6 PREFIXES AND TAGS names in the target source language(s) by concatenating a prefix to the user-specified identifier. When you specify a prefix for an aggregate, SDL applies the prefix to all members of the aggregate and to named constants declared in it, but not to the name of the aggregate itself. declared in it, but not to the name of the aggregate itself. underscore. For example: er-specified string, a tag letter, and an underscore. For example: 2-18 USING SDL USING SDL id WORD; CTURE PREFIX opr$; "typename" CHAR CONSTANT ( ; fixe float_, _, ) EQUALS bits STRUCTURE; UALS 0 INCREMENT 1; variable_siz size_units BITFIELD LE END bits; BITFIELD LENGTH 3; END operator; s; END operator; because it is an SDL keyword. er is enclosed in quotations marks because it is an SDL keyword. This declaration produces the following identifiers: opr$w_id opr$t_type opr$k_fixed_bin_ opr$k_float_ n_ opr$_bits _ opr$v_varia opr$v_size_units e opr$v_fill_0 ts opr$v_fill_0 portion of a name when the TAG option is not specified. The default codes are the standard VAX codes, based on the data type of the name they represent. For a list of these codes, see the Default Tag Letters Table in Chapter 3. You can override the default codes by specifying a tag, which may be null. For example: default codes by specifying a tag, which may be null. For example: EQUALS 0 INCREMENT 1 P EQUALS 0 INCREMENT 1 PREFIX new TAG ""; This declaration results in the names new_abc, new_def, and new_ghi. This declaration results in the names new_abc, new_def, and new_ghi. aggregate members. The tag that you specify, however, affects only the identifier you specify it with. For example, a tag you supply in an AGGREGATE declaration affects only the aggregate name, thus, if you wish to change all the tags in an aggregate, you must do it on a member-by-member basis. gs in an aggregate, you must do it on a member-by-member basis. 2-19 CHAPTER 3 CHAPTER 3 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE 3.1 LANGUAGE AND COMMAND REFERENCE 3.1 LANGUAGE AND COMMAND REFERENCE This section provides concise syntax rules for SDL, including: o The SDL command o Syntax rules o SDL declarations o Storage classes o Dimensions o Prefixes and tags o Translation tables for target output languages 3-1 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE 3.1.1 The SDL Command 3.1.1 The SDL Command one or more target languages. translator to produce source files for one or more target languages. Format Format SDL file-spec,... File Qualifiers Defaults File Qualifiers Defaults /[NO]COPYRIGHT /NOCOPYRIGHT /[NO]DUMP /NODUMP GHT /[NO]GLOBAL_DEFINITION /NOGLOBAL /[NO]HEADER /HEADER _DEFINITION /LANGUAGE=(language[=file-spec],...) No langua /[NO]LIST[=file-spec] /NOLIST (inter /LIST (batch) ctive) /[NO]MODULE /MODULE tch) /[NO]PARSE[=file-spec] /PARSE /[NO]VMS_DEVELOPMENT /NOVMS_D /[NO]VMS_DEVELOPMENT /NOVMS_DEVELOPMENT Prompts Prompts File: file-spec,... Command Parameter Command Parameter file-spec,... A file specification must specify a file name; if it does not include a file type, SDL uses the default file type of SDL. You can specify multiple input files, separated by commas. SDL translates each source file individually and creates separate output files for each. ile individually and creates separate output files for each. No wild cards are allowed in the file specification. File Qualifiers they may be used to qualify individual file specifications. or they may be used to qualify individual file specifications. /[NO]COMMENTS generated. For more compact target language representation, in generated. For more compact target language representation, in 3-2 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE permanent files, use /NOCOMMENTS in order to save permanent file space. /NOCOMMENTS is the default. order to save permanent file space. /NOCOMMENTS is the default. /[NO]COPYRIGHT with the translated output. When /COPYRIGHT is specified, the translator precedes the output with a 20-line comment containing the standard DIGITAL copyright claim. By default, no copyright header is produced. L copyright claim. By default, no copyright header is produced. /[NO]DUMP file is printed on the terminal. By default, no intermediate representation is printed. erminal. By default, no intermediate representation is printed. /[NO]GLOBAL_DEFINITION attribute generates a declaration that indicates 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 Section 3.1.8 for details. ual language translation summaries in Section 3.1.8 for details. attribute designates global data whose value is defined elsewhere. designates global data whose value is defined elsewhere. /[NO]HEADER name is included at the beginning of the output file. By default, the header is included. ning of the output file. By default, the header is included. /LANGUAGE=(language[=file-spec],...) indicating the target source languages for which SDL is to produce output for the associated input file. By default, SDL writes its output source files into separate files in the current default directory. It uses the file name of its input file and the default file type for each compiler to name the target source files. ult file type for each compiler to name the target source files. builds the language image name by concatenating the prefix 'SDL' to the option. If /LANGUAGE=FORTRA was specified, SDL searches for and activates the shareable image SDLFORTRA.EXE. You may abbreviate most language options, but SDL will use the first image it finds that matches the generated file specification. For example, if you wish to invoke the BLISSF back end instead of For example, if you wish to invoke the BLISSF back end instead of 3-3 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE the BLISS back end, you must spell out /LANGUAGE=BLISSF. SYS$SHARE. By defining a logical name for the language name, you can override this default. If a logical name, SDLFORTRA, is defined to be MYDISK:SDLFORT.EXE, then the command DLFORTRA, is defined to be MYDISK:SDLFORT.EXE, then the command $ SDL/LANGUAGE=FORTRA foo.sdl $ SDL/LANGUAGE=FORTRA foo.sdl source file. the image MYDISK:SDLFORT.EXE to generate the output source file. specification for one or more target language output files. Specify a language option followed by the destination file specification for the output file 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. and separate specifications for different languages with commas. output for each target SDL language. ons and default file types output for each target SDL language. /[NO]LIST Controls whether a listing file is produced. the default. If the SDL command is executed from batch mode, /LIST is the default. SDL command is executed from batch mode, /LIST is the default. same file name as the related source file and a file type of LIS. same file name as the related source file and a file type of LIS. /[NO]MODULE in the output source. The default is /MODULE. Note that this qualifier has no effect on languages other than PASCAL and Ada. qualifier has no effect on languages other than PASCAL and Ada. /[NO]PARSE=[file-spec] An SDL intermediate file contains already-parsed SDL source code. This file is written with the /PARSE command. The default extension for the SDL intermediate file is .SDI. The default extension for the SDL intermediate file is .SDI. be used as input to SDL rather than SDL source code. This can be done using the /NOPARSE command. When this command appears in an SDL command line, the input file-spec is assumed to be an SDL intermediate file. Again, the default extension is .SDI for the input file-spec. See examples 4 and 5 below. n is .SDI for the input file-spec. See examples 4 and 5 below. 3-4 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE /[NO]VMS_DEVELOPMENT is produced. When /VMS_DEVELOPMENT is specified, the VMS macros $EQU, $DEF, $DEFINI, and $DEFEND are used in the .MAR output file. /VMS_DEVELOPMENT also causes BLISS output files to contain KEYWORD macros for entry declarations. /NOVMS_DEVELOPMENT is the default. cros for entry declarations. /NOVMS_DEVELOPMENT is the default. Table 3-1: SDL Language Options and File Types Table 3-1: SDL Language Options and File Types Language Option Target File Type Language Option Target File Type /LANGUAGE=BLISSF .R32(1 VAX C /LANGUAGE=CC .H (1) VAX FORTRAN /LANGUAGE=FORTRA .FOR VAX MACRO /LANGUAGE=MACRO .MAR VAX PL/I /LANGUAGE=PLI .PLI VAX PASCAL /LANGUAGE=PASCAL .PAS VAX DATATRIEVE /LANGUAGE=DTR .DTR VAX Ada /LANGUAGE=ADA .ADA ELN Pascal /LANGUAGE=EPASCA .PAS ELN Pascal /LANGUAGE=EPASCA .PAS 1 The BLISSF back 1 The BLISSF back end generates BLISS FIELDSETS for SDL aggregates. Examples Examples 1. $ SDL BLOCKNODE/LANGUAGE=(PLI=PLI$:[PL1.PSRC],CC=C$:[C.CSRC]) 1. $ SDL BLOCKNODE/LANGUAGE=(PLI=PLI$:[PL1.PSRC],CC=C$:[C.CSRC]) PL/I and C, writes the PL/I output file to PLI$:[PL1.PSRC], and writes the C output file to C$:[C.CSRC]. file to PLI$:[PL1.PSRC], and writes the C output file to C$:[C.CSRC]. 2. $ SDL VTREE.SRC/LANGUAGE=(PLI=[PLI.PSRC]) 2. $ SDL VTREE.SRC/LANGUAGE=(PLI=[PLI.PSRC]) directory [PLI.PSRC]. arations and writes its PL/I output file to the directory [PLI.PSRC]. 3. $ SDL/LANGUAGE=(MACRO,BLISS) IODEF,SSDEF 3. $ SDL/LANGUAGE=(MACRO,BLISS) IODEF,SSDEF produces IODEF.MAR and IODEF.R32 as well as SSDEF.MAR and SSDEF.R32. produces IODEF.MAR and IODEF.R32 as well as SSDEF.MAR and SSDEF.R32. 4. $ SDL/PARSE=INTER TEST 4. $ SDL/PARSE=INTER TEST outputs an SDL intermediate file called INTER.SDI. ile TEST.SDL and outputs an SDL intermediate file called INTER.SDI. 3-5 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE 5. $ SDL/NOPARSE/LANG=(MACRO, BLISS) INTER 5. $ SDL/NOPARSE/LANG=(MACRO, BLISS) INTER SDL parser in INTER.SDI and produces files INTER.MAR and INTER.R32. e SDL parser in INTER.SDI and produces files INTER.MAR and INTER.R32. 3.1.2 Syntax Rules 3.1.2 Syntax Rules and expressions, terminated by a semicolon. Spaces or tabs delimit these elements in a declaration. a semicolon. Spaces or tabs delimit these elements in a declaration. 3.1.2.1 Names - 3.1.2.1 Names - specify source program identifiers. These and SDL local symbol names are subject to the following rules: These and SDL local symbol names are subject to the following rules: dollar sign ($), and underscore (_). rough z, 0 through 9, dollar sign ($), and underscore (_). character, a dollar sign, or an underscore. h an alphabetic character, a dollar sign, or an underscore. o SDL local symbols must begin with a number sign (#). SDL characters, can be enclosed in quotation marks. invalid SDL characters, can be enclosed in quotation marks. case in which they are defined. h to the source file(s) in the same case in which they are defined. 3.1.2.1.1 Expressions - output constants, and SDL local symbols. By default, numeric constants are assumed to be expressed in decimal notation. You can override this default by prefixing a constant with one of the following: is default by prefixing a constant with one of the following: Prefix Interpretation Valid Characters Prefix Interpretation Valid Characters %O Octal 0 through 7 A through F %B Binary 0 and 1 7 %A ASCII value Any ASCII %A ASCII value Any ASCII character 3-6 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE SDL treats decimal constants as signed longwords. follows it. or takes the ASCII value of any ASCII character that follows it. constant by enclosing the string in quotation marks ("). SDL inserts the ASCII value of each character into the byte field corresponding to that character's position in the string. byte field corresponding to that character's position in the string. 3.1.2.1.2 Operators - and integer variables. They are listed in order of precedence, with the operators of higher precedence listed first. of precedence, with the operators of higher precedence listed first. Operator Meaning Operator Meaning * Arithmetic multiplica / Arithmetic division tion + Arithmetic addition - Arithmetic subtractio @ Logical shift--x@y shift right y places; if y is negative, the value of x is shifted y places to the left the value of x & Logical AND places to the left ! Logical OR ! Logical OR evaluation. Expressions within the innermost set of parentheses are evaluated first. essions within the innermost set of parentheses are evaluated first. 3.1.2.2 Output Comments - 3.1.2.2 Output Comments - the current line. They can appear in the following contexts: end of the current line. They can appear in the following contexts: o Outside module declarations following the semicolon terminator a declaration; that is, following the semicolon terminator or AGGREGATE declarations een member, CONSTANT, ENTRY, ITEM, or AGGREGATE declarations o Between declarations within an aggregate 3-7 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE list of CONSTANT declarations ames within a comma-delimited list of CONSTANT declarations 3.1.2.3 Local Comments - 3.1.2.3 Local Comments - extend to the end of the line. They can appear anyplace within the source file (not necessarily within a module) where white space (space, tab, or carriage return) is allowed. SDL does not output local comments to target language source files. SDL does not output local comments to target language source files. 3.1.3 Declarations 3.1.3 Declarations 3.1.3.1 MODULE Declarations - 3.1.3.1 MODULE Declarations - A MODULE declaration produces a source module. module-body; ame [IDENT ident-string]; . ule-body; . . END_ END_MODULE [ module-name ]; module-name Any valid SDL identifier you want to use to identify the module. ident-string in quotation marks, that further identifies the module or supplies version information. rther identifies the module or supplies version information. module-body One or more of the following: o Local symbol declarations o CONSTANT declarations o ITEM declarations o AGGREGATE declarations 3-8 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE o ENTRY declarations o Comments END_MODULE [module-name] specified, must match the name on the most recently specified MODULE declaration. ch the name on the most recently specified MODULE declaration. modules may not be nested. tain multiple MODULE declarations, but modules may not be nested. 3.1.3.2 Local Symbol Declarations - 3.1.3.2 Local Symbol Declarations - known only within an SDL source file and are not directly translatable to the target language source file. and are not directly translatable to the target language source file. #local-name = expression; #local-name sign (#). DL identifier. Local names must begin with a number sign (#). expression Any valid SDL expression resulting in a longword integer value. file. A local symbol does not need to be declared before it is assigned a value; however, if it is referenced before it has been assigned a value, SDL outputs an error message and does not produce any output files. SDL outputs an error message and does not produce any output files. 3.1.3.3 CONSTANT Declarations - 3.1.3.3 CONSTANT Declarations - constants. larations generate declarations of one or more named constants. CONSTANT constant-name EQUALS expression [ PREFIX prefix-string ] [ TAG tag-string ] [ COUNTER #local-name ] ; 3-9 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE CONSTANT (constant-name,...) EQUALS expression [ INCREMENT expression ] [ PREFIX prefix-string ] [ TAG tag-string ] [ COUNTER #local-name ] ; CONSTANT (constant-name,...) EQUALS expression, [ INCREMENT expression ] [ PREFIX prefix-string ] [ TAG tag-string ] [ COUNTER #local-name ] . stant-name,...) EQUALS expression, . . ; . ; constant-name declaration for a named constant. This can be any valid SDL identifier. for a named constant. This can be any valid SDL identifier. expression SDL expression. ssigned to the constant. This can be any valid SDL expression. PREFIX prefix-string name, may or may not be enclosed in quotation marks, and may be null. (See Section 3.1.7, "Prefixes and Tags.") rks, and may be null. (See Section 3.1.7, "Prefixes and Tags.") TAG tag-string follows the prefix if there is one. It can have zero to four alphabetic characters and may or may not be enclosed in quotation marks. (See Section 3.1.7, "Prefixes and Tags.") d in quotation marks. (See Section 3.1.7, "Prefixes and Tags.") COUNTER #local-name is assigned to a constant in the list. to the last value which is assigned to a constant in the list. 3-10 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE (constant-name,...) A list of valid names. by commas and the list enclosed in parentheses. ust be separated by commas and the list enclosed in parentheses. value is reserved. his list can be null. The corresponding value is reserved. specified in the EQUALS expression. mes are assigned the value specified in the EQUALS expression. INCREMENT expression SDL's generation of named constant declarations. It must be a valid SDL integer expression. SDL assigns the value of the expression to the first name in the list, increments the expression by the increment value, and assigns that value to the next name in the list. ent value, and assigns that value to the next name in the list. 3.1.3.4 AGGREGATE Declarations - 3.1.3.4 AGGREGATE Declarations - AGGREGATE declarations produce declarations of structures and unions. {UNION } [ GLOBAL ] {data-type} [ BASED pointer-name ] {data-type} [ BASED pointer-name ] [ DIMENSION [lbound:]hbound ] [ MARKER marker-string ] [ PREFIX#prefix-string ] [ TAG tag-string ] [ ORIGIN member-name ] aggregate-body [ FILL ] ; . ate-body . . END [ END [ aggregate-name ]; 3-11 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE aggregate-name declaration of the aggregate. the base name to be used in the declaration of the aggregate. UNION RE data-ty data-type Declarations.") gate. (See Section 3.1.3.6, "Implicit Union Declarations.") GLOBAL BASED po BASED pointer-name (See Section 3.1.5, "Storage Classes.") If an aggregate is the object of an ADDRESS declaration, it must have either the default or the BASED pointer-name storage class. have either the default or the BASED pointer-name storage class. DIMENSION [lbound:]hbound aggregate is to be an array. (See Section 3.1.6, "Dimensions.") aggregate is to be an array. (See Section 3.1.6, "Dimensions.") MARKER marker-string valid SDL name, may or may not be enclosed in quotation marks, and may be null. It precedes the prefix and tag in the SDL-generated name. It precedes the prefix and tag in the SDL-generated name. PREFIX prefix-string may be any valid SDL name, may or may not be enclosed in quotation marks, and may be null. (See Section 3.1.7, "Prefixes and Tags.") ks, and may be null. (See Section 3.1.7, "Prefixes and Tags.") TAG tag-string follows the prefix if there is one. It can have zero to four alphabetic characters and may or may not be enclosed in quotation marks. (See Section 3.1.7, "Prefixes and Tags.") d in quotation marks. (See Section 3.1.7, "Prefixes and Tags.") ORIGIN member-name as the origin of the aggregate. s aggregate that is to be used as the origin of the aggregate. 3-12 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE FILL example, the named aggregate is intended to force alignment on the following aggregate. For some languages, the aggregate declaration will not appear in the output file. the aggregate declaration will not appear in the output file. aggregate-body One or more of the following: level-1 members of the aggregate mes and data types of all level-1 members of the aggregate o Subaggregate declarations o Local symbol assignments o CONSTANT declarations END [ aggregate-name ] aggregate-name, if specified, must match the name on the most recently specified aggregate or subaggregate declaration. e most recently specified aggregate or subaggregate declaration. 3.1.3.4.1 STRUCTURE Declarations - that are structures; that is, whose members occupy consecutive storage locations and are not overlaid. se members occupy consecutive storage locations and are not overlaid. Aggregate declaration: AGGREGATE aggregate-name STRUCTURE [other-options] ; Subaggregate declaration: member-name STRUCTURE [other-options] ; for a subaggregate. All other AGGREGATE options are valid. e invalid for a subaggregate. All other AGGREGATE options are valid. 3.1.3.4.2 UNION Declarations - are unions; that is, whose first-level members occupy the same storage locations. that is, whose first-level members occupy the same storage locations. 3-13 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE Aggregate declaration: AGGREGATE aggregate-name UNION [other-options] ; Subaggregate declaration: member-name UNION [other-options] for a subaggregate. All other AGGREGATE options are valid. An alternative way of specifying a union is to use a "data-type" in place of the UNION keyword. In this case, the declared aggregate is a union consisting of the given aggregate members in the form of an unnamed structure, in parallel with one member whose name and data type are those given in the aggregate declaration. hose name and data type are those given in the aggregate declaration. 3.1.3.5 Member Declarations - 3.1.3.5 Member Declarations - aggregate. arations produce declarations of the members of an aggregate. { aggregate-name } DIMENSION [lbound:]hbound ] } [ [ PREFIX prefix-string ] [ TAG tag-string ] [ FILL ] ; member-name Any valid SDL identifier giving the name of the member. data-type data-type keyword. (See Section 3.1.4, "Data Types.") an SDL data-type keyword. (See Section 3.1.4, "Data Types.") aggregate-name type name. The name must be the full (SDL-expanded) aggregate name, including prefix and tag. he full (SDL-expanded) aggregate name, including prefix and tag. DIMENSION [lbound:]hbound be an array. (See Section 3.1.6, "Dimensions.") member is to be an array. (See Section 3.1.6, "Dimensions.") 3-14 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE PREFIX prefix-string prefix is used to form the names of subaggregate members. It may be any valid SDL name, may or may not be enclosed in quotation marks, and may be null. (See Section 3.1.7, "Prefixes and Tags.") nd may be null. (See Section 3.1.7, "Prefixes and Tags.") TAG tag-string follows the prefix if there is one. It can have zero to four alphabetic characters and may or may not be enclosed in quotation marks. (See Section 3.1.7, "Prefixes and Tags.") d in quotation marks. (See Section 3.1.7, "Prefixes and Tags.") FILL example, the named member is intended to force alignment on the following member. For some languages, the member declaration will not appear in the output file. s, the member declaration will not appear in the output file. 3.1.3.6 Implicit Union Declarations - 3.1.3.6 Implicit Union Declarations - structure declaration to become an implicit union declaration. This implicit union feature gives the maintainer of complicated structures certain benefits. ure gives the maintainer of complicated structures certain benefits. need to define extraneous structure and union names. ut the need to define extraneous structure and union names. of most use for data structures containing substructures that are required to begin at fixed offsets. g substructures that are required to begin at fixed offsets. (structure B defines the implicit union). ax of an implicit union (structure B defines the implicit union). B STRUCTURE LONGWORD bit_string1 BITFIEL bit_string2 BITFIELD LENGTH 4; END B; _string2 BITFIELD LENGTH 4; last_item W END A; m WORD; END A; SDL structure cit union is a way of representing the more cumbersome SDL structure AGGREGATE A STRUCTURE; 3-15 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE B LONGWORD; Y STRUCTU bit_string1 BIT bit_string2 BITFIELD LENGTH 4; END Y; ng2 BITFIELD LENGTH 4; last_item WO END X; m WORD; END A; X; END A; implicit union case). Y become SDL generated "filler" names in the implicit union case). implicit union is used. By giving the structure Y a type, SDL will create a union of field Y with the specified type overlayed with a structure containing the fields in Y. In some language translations such as BLISS and Macro, the SDL generated union and structure (X and Y above) can be surpressed in the output since they are considered extraneous fields. In other languages such as pli and C, it is necessary to use them to generate the correct offsets within a structure. Since the union is of the length specified in the structure type, no filler is necessary to ensure that subsequent fields (last_item above) are at the correct offset. If the fields of a structure extend past the size specified, SDL will flag the overflow. What follows is the PL/I translation for the above implicit union example. follows is the PL/I translation for the above implicit union example. ** PL/I translation ** ** PL/I translation ** 2 fill_0 unio 3 B fixed binary 3 fill_1 , nary(31), 4 bit_strin 4 bit_string2 bit(4), 4 fill_1$$v_fill_2 bit( 2 last_item fixed binary(15); 2 last_item fixed binary(15); implicit union for other languages. Chapter 4 for an example of an implicit union for other languages. 3.1.3.6.1 DIMENSION with Implicit Union - dimension. is an example of an SDL structure defined with type and dimension. first WORD; UCTURE WORD DIMENSION 3; second WORD; second WORD; 3-16 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE END fid; WORD; END fid; elements of the type specified by the structure type. an array of elements of the type specified by the structure type. single field or by each individual word so it is easily defined in SDL as represented above. What follows is the PL/I translation for the SDL source in the above example to illustrate the SDL interpretation. SDL source in the above example to illustrate the SDL interpretation. 2 fid (1:3) fixed binar 2 fill_1 , fixed binary(15), 3 first fix 3 second fixed binary(15); 3 third fixed binary(15); 3 third fixed binary(15); to modify any trailing fillers. SDL detects any overflow that may occur if the structure grows past the size of its datatype. The size of the aggregate (in bytes) is equal to the size of the datatype (in bytes) multiplied by the upper dimension (if any). If the size of the aggregate is greater than the sum of the size of all its members, SDL will not complain. However, if the size of the members exceeds the size of the aggregate, then SDL will issue a message of the form the size of the aggregate, then SDL will issue a message of the form %SDL-E-TOOMANYFIELDS, Structure fill_0 has too many fields [Line ?] (where fill_0 is the SDL generated name for the top union aggregate). 3.1.3.7 ITEM Declarations - 3.1.3.7 ITEM Declarations - ITEM declarations translate declarations of scalar items. [ GLOBAL ] [ GLOBAL ] [ DIMENSION [lbound:]hbound ] [ PREFIX prefix-string ] [ TAG tag-string ] ; name language(s). declared as a scalar item in the output source language(s). The name can be any valid SDL identifier. 3-17 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE data-type data type keyword. (See Section 3.1.4, "Data Types.") an SDL data type keyword. (See Section 3.1.4, "Data Types.") GLOBAL GLOBAL class, based. (See Section 3.1.5, "Storage Classes.") storage class, based. (See Section 3.1.5, "Storage Classes.") DIMENSION [lbound:]hbound array. (See Section 3.1.6, "Dimensions.") item is to be an array. (See Section 3.1.6, "Dimensions.") PREFIX prefix-string name, may or may not be enclosed in quotation marks, and may be null. (See Section 3.1.7, "Prefixes and Tags.") rks, and may be null. (See Section 3.1.7, "Prefixes and Tags.") TAG tag-string the name. It can have zero to four alphabetic characters and may or may not be enclosed in quotation marks. (See Section 3.1.7, "Prefixes and Tags.") in quotation marks. (See Section 3.1.7, "Prefixes and Tags.") 3.1.3.8 ENTRY Declarations - 3.1.3.8 ENTRY Declarations - constant. rations produce the declaration of an external entry constant. ENTRY entry-name [ PARAMETER (param-desc,...) ] [ RETURNS data-type ] [ VARIABLE ] [ ALIAS internal-name ] [ LINKAGE link-name ] ; [ TYPENAME type-name ] ; entry-name point. d SDL identifier giving the name of the external entry point. 3-18 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE PARAMETER (param-desc,...) Param-desc must be specified as follows: ernal entry, if any. Param-desc must be specified as follows: { [ VALUE ] } IN ] [ OUT ] { [ REF ] } [ { } NAMED param-name ] { ANY [ VALUE ] } [ { [ REF ] } DIMENSION expr ] { } [ { } [ DEFAULT constant-value ] { } [ TYPENAME type-name ] [ [ OPTIONAL ] data-type of the parameter. type keyword that specifies the data type of the parameter. DESCRIPTOR Indicates that a parameter is passed by descriptor. ANY that if you specify ANY, you cannot specify other data type keywords. u specify ANY, you cannot specify other data type keywords. VALUE Indicates that the parameter is passed by immediate value. REFERENCE Indicates that the parameter is passed by reference. structure-name parameter. The declaration of the structure must precede its reference in the PARAMETER option. ructure must precede its reference in the PARAMETER option. IN Indicates an input parameter. 3-19 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE OUT Indicates an output parameter. NAMED param-name Specifies the parameter name. DIMENSION expr The number of elements of an array parameter. on the dimensions of the actual parameter. mensions depends on the dimensions of the actual parameter. DEFAULT constant-value supporting this feature, this option allows optional appearance of an actual parameter. option allows optional appearance of an actual parameter. OPTIONAL sequence of (keyword) parameters for a call using the entry point name. This is supported only in BLISS and BLISSF output. e. This is supported only in BLISS and BLISSF output. TYPENAME type_name Supplies a named datatype that is not an SDL keyword. specified, must follow the data-type, ANY, or structure-name in the declaration. w the data-type, ANY, or structure-name in the declaration. RETURNS data-type function. pe returned by the external entry, if it is a function. VARIABLE entry point has a variable number of parameters and that not all corresponding arguments need be present in the argument list when the entry point is invoked. be present in the argument list when the entry point is invoked. ALIAS internal-name designate the entry point. ternal name that can be used to designate the entry point. 3-20 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE LINKAGE link-name "link-name") will be used in the expansion of the entry macro. d "link-name") will be used in the expansion of the entry macro. TYPENAME type-name Supplies a named datatype that is not an SDL keyword. 3.1.4 Data Types 3.1.4 Data Types the keywords from the following list. Keywords that are not self-explanatory or that require further attributes are followed by a brief description. that require further attributes are followed by a brief description. WORD [ UNSIGNED ] LONGWORD [ UNSIGNED QUADWORD [ UNSIGNED ] OCTAWORD [ UNSIGNED ] OCTAWORD [ UNSIGNED ] D_FLOATING G_FLOATING H_FLOATING H_FLOATING DECIMAL PRECISION (precision,scale) DECIMAL PRECISION (precision,scale) PRECISION (precision,scale) respectively, where precision is the total number of decimal digits and scale is the number of fractional digits. of decimal digits and scale is the number of fractional digits. expressions. and scale must be specified using valid SDL expressions. BITFIELD [ LENGTH length ] [ MASK ] [ SIGNED ] BITFIELD [ LENGTH length ] [ MASK ] [ SIGNED ] LENGTH length field. If no length is specified, SDL uses the default length of 1 bit. If no length is specified, SDL uses the default length of 1 bit. 3-21 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE MASK representing the bits defined in this field. a constant mask representing the bits defined in this field. SIGNED SDL keyword requesting SDL to treat the output as a signed field. objects of ADDRESS declarations, parameters, or return-types of entries. f ADDRESS declarations, parameters, or return-types of entries. BOOLEAN BOOLEAN CHARACTER [LENGTH length] [VARYING]; CHARACTER [LENGTH length] [VARYING]; LENGTH length using any valid SDL expression. If no length is specified, SDL uses the default length of 1 character. length is specified, SDL uses the default length of 1 character. VARYING character string (for languages that support this data type). In a varying-length character string, the first word of the string contains its current length; its declared length is the maximum length that it can have. gth; its declared length is the maximum length that it can have. ADDRESS [ (object-type) ] ADDRESS [ (object-type) ] object-type Object-type must be specified as follows: the address refers. Object-type must be specified as follows: { } { ENTRY [ PARAMETER (param-desc,...) ] } { [ RETURNS data-type ] } { } { structure-name } { structure-name } 3-22 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE data-type WORD, ADDRESS, CHARACTER, LONGWORD. than BITFIELD; for example, WORD, ADDRESS, CHARACTER, LONGWORD. ENTRY also specify parameter descriptions and a return data type as described for ENTRY declarations. ons and a return data type as described for ENTRY declarations. structure-name either no storage class attribute or the BASED pointer-name storage class. age class attribute or the BASED pointer-name storage class. 3.1.5 Storage Classes 3.1.5 Storage Classes language-dependent. In general, declarations produce a template describing data for which the compiler does not allocate storage at compile time. This type of storage is called "based". Based storage is used if neither COMMON nor GLOBAL is specified. d". Based storage is used if neither COMMON nor GLOBAL is specified. the exception of PL/I) to the declaration generated when no storage class is specified. For PL/I, SDL generates the following attribute: class is specified. For PL/I, SDL generates the following attribute: BASED (pointer-name) usually by means of an external program section with the OVR attribute for an aggregate or item. rnal program section with the OVR attribute for an aggregate or item. elsewhere. SDL does not generate definitions for global symbols directly. However, the MACRO-32 output routine generates all declarations within macros so that they can be invoked with arguments that will produce global definitions. The "MACRO-32 Translation Summary" in Section 3.1.8 describes how to invoke these macro definitions to generate global symbol definitions. voke these macro definitions to generate global symbol definitions. affects the operation of the GLOBAL attribute. When this qualifier is used, GLOBAL generates a reference to global data whose value is defined in this module. See the individual translation summaries for the exact effect of /GLOBALDEF in each language. lation summaries for the exact effect of /GLOBALDEF in each language. 3-23 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE which it belongs. ys acquires the storage class of the aggregate to which it belongs. 3.1.6 Dimensions 3.1.6 Dimensions A dimension can be applied to an aggregate, subaggregate, or item. DIMENSION [lbound:]hbound lbound lowest-numbered element of the array. If lbound is not specified, SDL supplies a default lbound of one. lbound is not specified, SDL supplies a default lbound of one. hbound array, or, if lbound is specified, the highest-numbered element. array, or, if lbound is specified, the highest-numbered element. 3.1.7 Prefixes and Tags 3.1.7 Prefixes and Tags exactly as you enter them in the SDL source file, including uppercase and lowercase. You can use the PREFIX and TAG options on AGGREGATE, subaggregate, CONSTANT, and ITEM declarations to cause SDL to generate prefixes for data items or aggregate members. o cause SDL to generate prefixes for data items or aggregate members. 3.1.7.1 Prefixes - 3.1.7.1 Prefixes - forming identifiers for all items and aggregate members. to use in forming identifiers for all items and aggregate members. PREFIX prefix-string prefix-string all member names. It can be any valid SDL identifier. plied to all member names. It can be any valid SDL identifier. of each member using the prefix, followed by a tag, an underscore, and the member name. fix, followed by a tag, an underscore, and the member name. 3-24 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE subaggregate, the specified prefix is used only in forming the names of the aggregate or subaggregate's members, and not the name of the aggregate or subaggregate itself. rs, and not the name of the aggregate or subaggregate itself. for a particular aggregate member. If this member happens to be a subaggregate, the new prefix will be applied to all of the members of that subaggregate. Otherwise, if no prefix is specified for a subaggregate, all subaggregate members get the same prefix as that specified on the containing aggregate. the same prefix as that specified on the containing aggregate. 3.1.7.2 Tags - 3.1.7.2 Tags - identifiers. You must use the TAG option for each item, member, aggregate, or subaggregate name for which you want to override. mber, aggregate, or subaggregate name for which you want to override. TAG tag-string tag-string the name. If the TAG option is not specified, SDL uses a default code based on the data type of the name. ied, SDL uses a default code based on the data type of the name. which may be null, and an underscore character (_) to the current prefix-string. A tag option of a single underscore character produces a single underscore character in any resulting names. r produces a single underscore character in any resulting names. specified for an aggregate member, SDL uses the default tag letters shown in table 3-2. member, SDL uses the default tag letters shown in table 3-2. 3-25 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE Table 3-2: Default Tag Letters Used by SDL Table 3-2: Default Tag Letters Used by SDL Data Type Default Declaration Tag Lette Declaration Tag Letter Declaration Tag Letter BYTE [UNSIGNED] B WORD [UNSIGNED] W LONGWORD [UNSIGNED] L QUADWORD Q OCTAWORD O F_FLOATING F D_FLOATING D G_FLOATING G H_FLOATING H DECIMAL P BITFIELD V f S for BITFIELD size M for BITFIELD mask(1 CHARACTER T or BITFIELD mask(1) ADDRESS A STRUCTURE R UNION R UNION R 1 Names with size regardless of whether a PREFIX or TAG option is specified. enerated regardless of whether a PREFIX or TAG option is specified. 3-26 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE 3.1.8 Translation Summaries 3.1.8 Translation Summaries constructs into the following languages: t routines translate SDL constructs into the following languages: o VAX BLISS o VAX C o VAX FORTRAN o VAX MACRO-32 o VAX PL/I o VAX PASCAL o VAX DATATRIEVE o ELN PASCAL o VAX Ada 3-27 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE 3.1.8.1 BLISS-32 Translation Summary - 3.1.8.1 BLISS-32 Translation Summary - ISS-32 Output MODULE name !* IDENT string ! string E name *** IDENT string ! string /* comment ! comment CONSTANT x EQUALS n; LITERAL x = n; PARAMETER (type,...) EXTERNAL ROUTINE name: ANY n/a NAL ROUTINE name: NOVALUE ; DESCRIPTOR n/a IN n/a OUT n/a NAMED param-name n/a VALUE n/a REF n/a DEFAULT const-val Used option, gives "= const-val" S_DEV TYPENAME type-name n/a n, gives "= const-val" OPTIONAL Used %IF NOT %NULL({name\{) %THEN, {name\{ RETURNS data-type %IF NOT %NULL({name\{) %THEN, {name\{ %FI VARIABLE ALIAS internal-name Used option, gives name for BLISS macro LINKAGE n/a n, gives name for BLISS macro TYPENAME type-name n/a TYPENAME type-name n/a SDL produces a BLISS-32 macro declaration UNION of the form: BLISS-32 macro declaration UNION of the form: BYTE MACRO name = off,pos,size,ext %; WORD off LONGWORD Byte QUADWORD item within the current aggregate. OCTAWORD item within the current aggregate. BYTE UNSIGNED pos WORD UNSIGNED The b LONGWORD UNSIGNED The bit position from the offset. QUADWORD UNSIGNED size OCTAWORD UNSIGNED The si F_FLOATING in bits, if the size is 4 bytes or D_FLOATING less. Otherwise, this field G_FLOATING contains 0, and SDL generates the H_FLOATING size declaration: DL generates the DECIMAL PRECISION (p,q) ize declaration: DECIMAL PRECISION (p,q) 3-28 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE MASK n prefix$_name = size; SIGNED BOOLEAN CHARACTER LENGTH N where the size is given in bytes. VARYING ext ADDRESS Conta extended, or 1 if the value is sign extended or SIGNED bit. ue is sign In the case of BLISSF out aggregate and associated member declaration in SDL produces a BLIS field declaration. The fieldset name is generated by SDL in the form of prefix$name_FIELDSET, where prefix is declared for the entire aggregate and name is the aggregate name. gate and name is the aggregate name. SET refix$name_FIELDSET = membe . r-name = [off,pos,size,ext]; . . TES; MACRO pr MACRO prefix$_name BLOCK ; [pref$_name,BYTE] BLOCK FIELD (prefix$name_FIELDSET) Default storage class n/a (prefix$name_FIELDSET){%; Default storage class n/a COMMON storage class n/a with /GLOBALDEF GLOBAL BAL BASED pointer-name n/a BASED pointer-name n/a DIMENSION [lbound:]hbound Notes: Notes: classes. 32 output routine does not assign data to storage classes. 3-29 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE 3.1.8.2 C Translation Summary - 3.1.8.2 C Translation Summary - Declarati Output MODULE name /* IDENT string /* string */ me ***/ IDENT string /* string */ /* comment /* comment */ CONSTANT x EQUALS n #define x n PARAMETER (type,...) urn-type name() ANY n/a DESCRIPTOR n/a IN n/a OUT n/a NAMED param-name n/a VALUE n/a REF n/a DEFAULT n/a OPTIONAL n/a TYPENAME type-name n/a RETURNS return-type a VARIABLE n/ ALIAS n/a LINKAGE n/a TYPENAME type-name n/a TYPENAME type-name n/a CTURE struct UNIO UNION union name WORD short int n name LONGWORD int name name name QUADWORD int name [ name OCTAWORD int name [4] name BYTE UNSIGNED unsigned char name WORD UNSIGNED unsigned short name LONGWORD UNSIGNED unsigned int int name QUADWORD UNSIGNED unsigned int n name OCTAWORD UNSIGNED unsigned int name [4] name F_FLOATING float name name [4] name D_FLOATING double name name G_FLOATING int name [2] name H_FLOATING int name [4] name DECIMAL precision char name [p/2 (p,q) L precision char name [p/2+1] name BITFIE MASK ELD LENGTH n unsigned name:n MASK 3-30 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE name BOOLEAN char name CHARACTER LENGTH n char name[n VARYING st char STRING_TEXT[n];} name LENGTH; char STRING_TEXT[n];} name (object-type) object-type *name (object-type) as the tag, and no declared variable names. as the tag, and no declared variable names. COMMON storage class extern attribute with /GLOBALDEF globaldef attribute with /GLOBALDEF globaldef attribute for the based item. erated for the based item. the number of elements specified with subscripts ranging from 0 to (hbound - lbound + 1). ging from 0 to (hbound - lbound + 1). ORIGIN member-name n/a 3-31 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE 3.1.8.3 FORTRAN Translation Summary - 3.1.8.3 FORTRAN Translation Summary - Declarat FORTRAN Output MODULE name IDENT string ! string ame *** IDENT string ! string /* comment ! comment CONSTANT x EQUALS n PARAMETER x = n PARAMETER (type,...) EXTERNAL name ANY DESCRIPTOR n/a IN n/a OUT n/a NAMED param-name n/a VALUE n/a REF n/a DEFAULT n/a OPTIONAL n/a TYPENAME type-name n/a TURNS return-type type VARIABLE n/a name ALIAS n/a LINKAGE n/a TYPENAME type-name n/a TYPENAME type-name n/a declaration then a FORTRAN STRUCTU declaration is generated. If this is a subaggregate declaration, no is is structure is generated. n, no structure is generated. UNION UNION and associated MAP declarations name WORD INTEGER*2 n name LONGWORD INTEGER*4 name name QUADWORD INTEGER*4 name(2 name OCTAWORD INTEGER*4 name(4) name BYTE UNSIGNED BYTE name ame(4) name WORD UNSIGNED INTEGER*2 n name LONGWORD UNSIGNED INTEGER*4 name name QUADWORD UNSIGNED INTEGER*4 name(2 name OCTAWORD UNSIGNED INTEGER*4 name(4) name F_FLOATING REAL*4 name e(4) name D_FLOATING REAL*8 name name G_FLOATING REAL*8 name name H_FLOATING REAL*16 name DECIMAL PRECISION (p,q) Undefined data DECIMAL PRECISION (p,q) Undefined data type, error INVOUT 3-32 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE with "V_" and "S_" tags ons MASK Mask declaration, with "M SIGNED n/a declaration, with "M" tag SIGNED n/a name BOOLEAN BYTE name VARYING STRUCTURE/name/nam INTEGER*2 LE CHARACTER*length T END STRUCTURE *length TXT END STRUCTURE name ADDRESS INTEGER*4 name Default storage class Local, static COMMON storage class COMMON /name/ name with /GLOBALDEF n/a with /GLOBALDEF n/a BASED pointer-name n/a DIMENSION [lbound:]hbound name(hbound - lbound) ORIGIN member-name n/a Notes: Notes: Fortran backend translates bitfields into PARAMETERS having a value of the associated structure offset. BYTE fillers (using the Fortran %FILL feature) are placed in the structures for alignment. e Fortran %FILL feature) are placed in the structures for alignment. 3-33 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE 3.1.8.4 MACRO-32 - 3.1.8.4 MACRO-32 - Declarati Declaration MACRO-32 Output IDENT string ; string e IDENT string ; string /* comment ;comment CONSTANT x EQUALS n; x = n ENTRY .EXTERNAL member-name ANY n/a DESCRIPTOR n/a IN n/a OUT n/a NAMED param-name n/a VALUE n/a REF n/a DEFAULT constant-value = con OPTIONAL n/a stant-value TYPENAME type-name n/a RETURNS data-type n/a VARIABLE n/a ALIAS Macro LINKAGE Call instruction (default is CALLS) TYPENAME type-name n/a instruction (default is CALLS) TYPENAME type-name n/a assignment equal to the byte offset UNION of the item, as follows: te offset UNION of the item, as follows: name WORD name = offset-value name LONGWOR name QUADWORD offset relative to the origin of name OCTAWORD level-1 aggregate. A constant the name BYTE UNSIGNED assignment of the form: stant name WORD UNSIGNED assignment of the form: name LONGWORD UNSIGNE name QUADWORD UNSIGNED prefix$_name = byte-size name OCTAWORD UNSIGNED name F_FLOATING aggregates, arrays, and chara name D_FLOATING strings. , arrays, and character name G_FLOATING strings. name H_FLOATING name DECIMAL PRECI name BITFIELD LENGTH n B the bit offset of the item, and a prefix$_name identifier is equal to prefix$_name identifier is equal to 3-34 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE the size of the bit field in bits. with the "m_" tag. e constants with the "m_" tag. SIGNED n/a name CHARACTER VARYING R LENGTH n name ADDRESS name ADDRESS in the absolute Psect $AB 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. ddress of the actual aggregate. a Psect that has the same name as the top-level aggregate or item, and the attributes SHR, GBL, and OVR. Constant offsets are produce for all aggregate members. roduced for all aggregate members. the top-level name, and produces offset constants for any aggregate members. ants for any aggregate with /GLOBALDEF Generates .G BLKB length for top-level name, and produces offset constants for any aggregate members. tants for any aggregate members. BASED pointer-name n/a to allow for the size of the array. to allow for the size of the array. name may be referenced using ber- negative offsets with member-na as the base. ts with member-name as the base. 3-35 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE Notes: Notes: generate either local symbol or global symbol definitions. Given the SDL source: symbol or global symbol definitions. Given the SDL source: CONSTANT bits E ITEM field BYTE PREFIX ts END_MODULE; YTE PREFIX tst$ COMMON; END_MODULE; The resulting SDL MACRO output is: bits'..equ'4 e,..EQU=<=>,..COL=<:> .SAVE u'4 .PSECT SHR,NOEXE,RD,WRT,LO tst$b_field'..col' lkb 1 EXE,RD,WRT,LONG .RESTORE ..col' lkb 1 ; tst$b_fiel .ENDM ield'..equ'0 .ENDM local definitions are: d without arguments, the resulting local definitions are: tst$b_fiel blkb 1 ld1: blkb 1 macro with the arguments <==> and <::>, as follows: oke the macro with the arguments <==> and <::>, as follows: simple ..EQU=<==> ..COL=<::> This invocation results in the definitions: tst$b_field blkb 1 ld1:: blkb 1 bit fields, aggregates, arrays, and character strings, using the tag S_ preceding the output identifier. r strings, using the tag S_ preceding the output identifier. to the SDL command), special forms of macros are produced for entry point declarations. l forms of macros are produced for entry point declarations. 3-36 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE 3.1.8.5 PL/I Translation Summary - 3.1.8.5 PL/I Translation Summary - Declarat Declaration PL/I Output IDENT string / string / / IDENT string / string / / comment / comment / CONSTANT x EQUALS n; %REPLACE x BY n; PARAMETER (type,...) (parame ANY ANY meter-descriptor,...) DESCRIPTOR DESCR IN n/a IPTOR OUT n/a NAMED param-name n/a VALUE VALUE REF n/a DEFAULT n/a OPTIONAL n/a RETURNS data-type RETUR VARIABLE OPTIONS(VARIABLE) scriptor) ALIAS n/a NS(VARIABLE) LINKAGE n/a LINKAGE n/a declaration is always assigned a level number of 1; subsequent sub- aggregates are assigned level number 2, 3, and so on. igned level numbers 2, 3, and so on. UNION UNION WORD FIXED BINARY(15) LONGWORD FIXED BINARY(31) QUADWORD BIT(64) ALIGNED OCTAWORD BIT(128) ALIGNED BYTE UNSIGNED BIT(8) ALIGNED WORD UNSIGNED BIT(16) ALIGNED LONGWORD UNSIGNED BIT(32) ALIGNED QUADWORD UNSIGNED BIT(64) ALIGNED OCTAWORD UNSIGNED BIT(128) ALIGNED F_FLOATING FLOAT BINARY(24) D_FLOATING FLOAT BINARY(53) G_FLOATING FLOAT BINARY(53) H_FLOATING FLOAT BINARY(113) DECIMAL PRECISION (p,q) DECIMAL (p,q) 3) DECIMAL PRECISION (p,q) DECIMAL (p,q) BITFIELD LENGTH n BIT(n) 3-37 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE SIGNED n/a ACE prefixM_name BY mask-value; BOOLEAN BIT(1 CHARACTER LENGTH n CHARACTER(n) VARYING VARYING (n) ADDRESS POINTER ADDRESS POINTER Default storage class BASED attribute COMMON storage class STATIC EXTERNAL with /GLOBALDEF GLOBALDEF with /GLOBALDEF GLOBALDEF BASED pointer-name aggregate BASED (pointer-name) [lbound:]hbound name ([lbound]:hbound) [lbound:]hbound ORIGIN member-name n/a Notes: Notes: UNSIGNED keyword by specifying the name in a POSINT built-in function. The integer value of the name will be returned. Note that this will work only if the sign bit is 0. eturned. Note that this will work only if the sign bit is 0. BITFIELD data type is a bit-string constant. option of the BITFIELD data type is a bit-string constant. 3-38 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE 3.1.8.6 PASCAL Translation Summary - 3.1.8.6 PASCAL Translation Summary - Declarati Declaration PASCAL Output IDENT string (* string *) *) IDENT string (* string *) /* comment (* comment *) CONSTANT x EQUALS n; CONST x = n { PROCEDURE } ame PARAMETER (type,...) (formal param_l ANY %REF [UNSAFE] ARRAY [ DESCRIPTOR $UBYTE, %STDESR for character strings, else %DESCR; [READONLY is used for , items passed by descriptor] d for IN Default passing mechanism (un overridden by OUT) anism (unless OUT VAR idden by OUT) NAMED param-name Param names will be generated of the form $P1,...$Pn. rated of the VALUE %IMMED ,...$Pn. REF %REF DEFAULT value = %IMM If parameter is DESCRIPTOR, or VALUE, then it w be passed by %REF. , then it will OPTIONAL n/a ssed by %REF. TYPENAME type-name n/a RETURNS data-type : dat VARIABLE n/a a-type ALIAS internal-name Resul internal-name used as entry-name. d LINKAGE n/a nal-name used as entry-name. TYPENAME type-name n/a TYPENAME type-name n/a STRUCTURE RECORD 0: ... ASE INTEGER OF . ... . n: n: ... WORD $WORD -- [WORD] -32768..327 LONGWORD INTEGER [WORD] -32768..32767 QUADWORD $QUAD -- L1: INTEGER; END L1: INTEGER; END 3-39 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE L3: INTEGER; END ; BYTE UNSIGNED $UBYTE -- [BYTE] 0..255 ER; END WORD UNSIGNED $UWORD -- [WORD] 0..65535 LONGWORD UNSIGNED UNSIGNED [WORD] 0..65535 QUADWORD UNSIGNED $UQUAD -- OCTAWORD UNSIGNED $UOCTA -- RECORD L0,L1,L2,L3: ; END UNSIGNED; EN F_FLOATING SINGLE UNSIGNED; END D_FLOATING DOUBLE G_FLOATING DOUBLE H_FLOATING QUADRUPL DECIMAL PRECISION (p,q) PACKED ARRA OF $PACKED_DEC .p+2-mod(p,2)] $PACKED_DEC -- [ BITFIELD LENGTH n $BIT1 -- [BIT(1)] BOOLEAN FE] O..15 $BIT2...$BIT32 -- [BIT(2),U etc. BIT32 -- [BIT(2),UNSAFE] 0..1 MASK CONST pre SIGNED n/a prefixM_name = mask-value; BOOLEAN BOOLE CHARACTER LENGTH n PACKED AR VARYING VARYING [n] OF CHAR F CHAR ADDRESS datatype ] OF CHAR If datatyp defaults to $DEFPTR which is defin as $DEFTYP; $DEFTYP is defined as [UNSAFE] INTEGER. is defined as [UNSAFE] INTEGER. Default storage class TYPE COMMON storage class [COMMON] with /GLOBALDEF [GLOBAL] with /GLOBALDEF [GLOBAL] BASED pointer-name TYPE pointer-name = structure-name. [lbound]:hbound If lbound is not supplied, it defaul to 1. nd is not supplied, it defaults ORIGIN member-name n/a ORIGIN member-name n/a Notes Notes the PASCAL MODULE statement cannot be used. L source file, the PASCAL MODULE statement cannot be used. lists, function return types, and pointer data types), they will be generated in a TYPE block at the beginning of the module. Names will be of the form module-name$$TYPn, where module. Names will be of the form module-name$$TYPn, where 3-40 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE is an integer beginning at 1 and incremented by 1 for each type generated in a module. 1 and incremented by 1 for each type generated in a module. will be generated for each possible bit field size, giving the appropriate subranges. Bit fields of length 1 are a special case. subranges. Bit fields of length 1 are a special case. BITFIELD data type is an integer. the MASK option of the BITFIELD data type is an integer. one avoids having to write many long intermediate field names in the Pascal source program. If the outer level is a structure, a PACKED RECORD is normally declared. If the outer level is a union, a PACKED RECORD CASE INTEGER is declared. is a union, a PACKED RECORD CASE INTEGER is declared. SDL, the entire aggregate is transformed into a PACKED RECORD CASE INTEGER. The intermediate field-names are themselves declared as BYTE_DATA fields. This translation scheme may result in several fields in the record having the same name. result in several fields in the record having the same name. 3-41 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE 3.1.8.7 DATATRIEVE Translation Summary - 3.1.8.7 DATATRIEVE Translation Summary - Declarati Declaration DATATRIEVE Output IDENT string ! IDENT string IDENT string ! IDENT string /* comment ! comment CONSTANT x EQUALS n; ! x=n PARAMETER (type,...) n/a ry name ANY n/a DESCRIPTOR n/a IN n/a OUT n/a NAMED param-name n/a VALUE n/a REF n/a DEFAULT n/a OPTIONAL n/a TYPENAME type-name n/a RETURNS data-type n/a VARIABLE n/a ALIAS n/a LINKAGE n/a TYPENAME type-name n/a TYPENAME type-name n/a AGGREGATE declaration is always assigned a level number of 1; subsequent subaggregates are assigned level numbers 2, 3, an so on. level numbers 2, 3, and so on. numbers assigned as above. All but the first union member have a REDEFINE first-field-name clause. The redefined fields cannot be larger than the first union member. e larger than the first union member. WORD USAGE IS WORD LONGWORD USAGE IS LONG QUADWORD USAGE IS QUAD OCTAWORD USAGE IS QUAD O BYTE UNSIGNED USAGE IS BYTE CCURS 2 TIMES WORD UNSIGNED USAGE IS WORD LONGWORD UNSIGNED USAGE IS LONG LONGWORD UNSIGNED USAGE IS LONG 3-42 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE F_FLOATING USAGE IS REAL D_FLOATING USAGE IS DOUBLE G_FLOATING USAGE IS DOUBLE H_FLOATING USAGE IS QUAD OCC DECIMAL PRECISION (p,q) USAGE IS PACKED PIC 9(p-q)V9(q BITFIELD LENGTH n ! name BIT position:size V9(q) (See Note 1) ion:size MASK ! maskname = val SIGNED n/a kname = value BOOLEAN USAGE CHARACTER LENGTH n PIC X(n) YTE VARYING A group fi level field-name. form: level+1 STRING_LE level+1 STRING_TEXT PIC X(n). WORD. ADDRESS USAGE IS LONG TEXT PIC X(n). ADDRESS USAGE IS LONG Default storage class n/a COMMON storage class n/a with /GLOBALDEF n/a with /GLOBALDEF n/a pointer-name USAGE pointer-name USAGE IS LONG [lbound:]hbound OCCURS hbound-lbound+1 TIMES [lbound:]hbound ORIGIN member-name n/a Notes: Notes: be union members, or they must 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 whenever possible to allocate the storage; otherwise, USAGE IS BYTE OCCURS n TIMES is used. storage; otherwise, USAGE IS BYTE OCCURS n TIMES is used. the following way: ates are output as record definitions in the following way: 1 aggregate-name. e_RECORD USING 2 member-name dat . r-name datatype. . . 3-43 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE ; . ; item name and the string "_RECORD". top-level aggregate or item name and the string "_RECORD". hyphens (-). ns ($) appearing in names are replaced by hyphens (-). 3-44 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE 3.1.8.8 EPASCAL Translation Summary - 3.1.8.8 EPASCAL Translation Summary - Declaratio Declaration EPASCAL Output IDENT string (* string *) *) IDENT string (* string *) /* comment (* comment *) CONSTANT x EQUALS n; CONST x = n { PROCEDURE } ame { PROCEDURE } is VAR with no attributes. mechanism ANY With VALUE, gives an ordinar value parameter; otherwise a VAR ER ANYTYPE parameter. erwise a VAR DESCRIPTOR For CHARACTER type, VARYING_STRING($Nn), n being the para eter number; VAR ANYTYPE otherwise. m- IN Unless overridden by OUT, causes no V to appear, also [REFERENCE] if VALUE is not specified. If /globaldef on E is command line, adds [READONLY]. OUT Overrides IN and/or REFERENCE. NAMED param-name Parameter name. If none given, names will be generated of the for $P1,...$Pn. generated of the form VALUE No attributes passed in the argument list; error otherwise. e argument list; error REF Adds [REFERE VAR will appear. f necessary, unless DEFAULT value := value for inte types. VAR parameters containing ta DEFAULT 0 are treated as [OPTIONAL Parameters with data types that L]. translate to BYTE_DATA with a defa 0 get initialized as ':= ZERO'. ult BOOLEAN parameters with DEFAULT 0 are initialized with ':= false'. OPTIONAL Adds [OPTIONAL] to VAR parameters; otherwise only allowed on types to which integers are assignment compati and generates := 0. signment compatible, RETURNS data-type : data-type := 0. VARIABLE Adds [LIST] t ALIAS internal-name n/a [LIST] to the last parameter. LINKAGE n/a LINKAGE n/a 3-45 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE STRUCTURE RECORD 0: ... ASE INTEGER OF . ... . n: n: ... WORD [WORD] -32768..327 LONGWORD INTEGER 2768..32767 QUADWORD LARGE_INT OCTAWORD BYTE_DATA(16) BYTE UNSIGNED [BYTE] 0..255 WORD UNSIGNED [WORD] 0..65535 LONGWORD UNSIGNED BYTE_DATA(4) 5 QUADWORD UNSIGNED BYTE_DATA(8) OCTAWORD UNSIGNED BYTE_DATA(16) F_FLOATING REAL ATA(16) D_FLOATING DOUBLE G_FLOATING DOUBLE H_FLOATING BYTE_DAT DECIMAL PRECISION (p,q) PACKED ARRAY [1 OF [BIT(4)]0..15 +2-(p mod 2)] BITFIELD LENGTH n $BIT1 -- [BIT(1)] $BIT2 -- [BIT(2)] 0..3 etc. [BIT(2)] 0..3 MASK CONST pre SIGNED n/a prefixM_name = %xmask-value; $BIT1 $BIT2 -- [BIT(2)] -2..1 etc. [BIT(2)] -2..1 (Note - 3 [BIT(32)]INTEGER, whether or not SIGNED is present.) ther or not BOOLEAN BOOLEAN present.) BOOLEAN BOOLEAN CHARACTER LENGTH n STRING(n) (CHAR if n = 1) VARYING VARYING_STRING(n) If datatyp ENTRY, it defaults to ANYTYPE is Default storage class TYPE it defaults to ANYTYPE COMMON storage class VAR [E with /GLOBALDEF error TERNAL] with /GLOBALDEF error with /GLOBALDEF VAR no attribute with /GLOBALDEF VAR no attributes Pointer-name is ignored. ge class. Pointer-name is ignored. 3-46 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE [lbound]:hbound If lbound is not supplied, it defaul to 1. d is not supplied, it defaults ORIGIN member-name n/a ORIGIN member-name n/a Notes: Notes: 1. MODULE statement to a comment. An Epascal MODULE statement would not allow one to %include the output. MODULE statement would not allow one to %include the output. 2. ENTRY declarations declaration, depending on whether a return type is specified. If the /GLOBALDEF option was specified, a SEPARATE declaration is generated; otherwise an EXTERNAL one is generated. The ALIAS and LINKAGE keywords are ignored on ENTRY declarations. and LINKAGE keywords are ignored on ENTRY declarations. 3. PARAMETER declarations attribute keywords. Parameters are given default names in Epascal of $P1, $P2, ..., but may be given an explicit name with the NAME keyword. The default parameter passing mechanism is VAR with no Epascal attributes. This is consistent with existing SDL files and the output produced for other languages. Otherwise, the attributes affect the parameters according to the following rules: es affect the parameters according to the following rules: parameter is declared. Otherwise, an ANYTYPE VAR parameter is declared. DESCRIPTOR and DEFAULT (the latter unless VALUE is also specified) attributes are disallowed by the SDL front end on ANY type parameters. e disallowed by the SDL front end on ANY type parameters. specified on a parameter, but rather on the entry. It has the effect of adding the Epascal [LIST] attribute to the last parameter. It is not allowed if the last parameter is also specified with DESCRIPTOR or DEFAULT or is a conformant array type (specified with DIMENSION *). is a conformant array type (specified with DIMENSION *). parameter is to be passed by a VAX descriptor. Since Epascal does not support these, a VAR ANYTYPE parameter is normally generated in this case. However, if the SDL data type is CHARACTER, a string or varying string conformant parameter is generated, as this matches the VAX parameter is generated, as this matches the VAX 3-47 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE $Nn, where "n" is the parameter number. This attribute is not allowed by the SDL front end with the VALUE, REFERENCE or DEFAULT attributes or ANY type, and the Epascal SDL backend disallows it with the VARIABLE attribute. cal SDL backend disallows it with the VARIABLE attribute. has no effect), this causes the parameter to be treated as an input parameter, and so no VAR appears. Unless the VALUE attribute is also present, the Epascal [REFERENCE] attribute is also added if the parameter would not normally be passed by reference. The Epascal [READONLY] attribute is added to the declaration if /GLOBALDEF was specified; this causes an Epascal routine to not make a copy of the argument. [READONLY] is not added if /GLOBALDEF was not specified because that would cause the calling routine to save the argument value unnecessarily. IN isn't allowed by the SDL front end with the DEFAULT attribute. llowed by the SDL front end with the DEFAULT attribute. causes the parameter to be passed with VAR semantics, but that's the normal case anyway. It does, however, override the REFERENCE and IN attributes. The SDL front end disallows the combination of OUT and VALUE, and the Epascal backend disallows the combination of OUT and DEFAULT. ackend disallows the combination of OUT and DEFAULT. immediately in the argument list if Epascal uses that method for the parameter's data type; otherwise, the Epascal backend generates an error. Thus, no Epascal attributes are generated. The SDL front end does not allow VALUE with DESCRIPTOR, OUT or REFERENCE. Since the LONGWORD UNSIGNED parameters translates to BYTE_DATA(4) in epascal, the VALUE attribute is ignored in this case. BYTE_DATA parameters are passed by REFERENCE. this case. BYTE_DATA parameters are passed by REFERENCE. to be passed by reference. Therefore, unless OUT was also specified, or the parameter's type is of a type that is normally passed by REFERENCE, the Epascal [REFERENCE] attribute is added. The SDL front end disallows REFERENCE in combinations with the VALUE, DESCRIPTOR or DEFAULT attributes. ons with the VALUE, DESCRIPTOR or DEFAULT attributes. to be specified, and therefore VAR semantics are not used. It is only allowed on data types to which integers are assignment compatible, or with the ANY type in combination with the VALUE attribute. The SDL front end disallows it with ANY type (unless VALUE is also present), DESCRIPTOR, IN, REFERENCE and OPTIONAL, and the Epascal backend IN, REFERENCE and OPTIONAL, and the Epascal backend 3-48 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE attribute or conformant array types (those specified with DIMENSION *). VAR parameters that have DEFAULT 0 specified are treated as optional parameters. BOOLEAN data with a DEFAULT 0 specified get an intial value of ':= false'. a DEFAULT 0 specified get an intial value of ':= false'. the Epascal [OPTIONAL] attribute. Otherwise, it is only allowed on types to which integers are assignment compatible and generates an Epascal default initializer of 0. The SDL front end does not allow it in conjunction with the DESCRIPTOR or DEFAULT attribute, and the SDL Epascal backend does not allow it in conjunction with conformant array types (those specified with DIMENSION *). It is ignored if specified on a parameter that will be given the [LIST] attribute. a parameter that will be given the [LIST] attribute. an Epascal ISO conformant array declaration to be generated for the parameter. Such a parameter has a lower bound of $Ln and an upper bound of $Un, where "n" is the parameter number. Such a parameter may not be declarad VARIABLE, OPTIONAL or DEFAULT. ter may not be declarad VARIABLE, OPTIONAL or DEFAULT. 4. Records and Variants one avoids having to write many long intermediate field names in the Epascal source program. If the outer level is a structure, a PACKED RECORD is normally declared. If the outer level is a union, a PACKED RECORD CASE INTEGER is declared. is a union, a PACKED RECORD CASE INTEGER is declared. SDL, the entire aggregate is transformed into a PACKED RECORD CASE INTEGER. The intermediate field-names are themselves declared as BYTE_DATA fields. This translation scheme can result in several fields in a record having the same name, in which case an error message is generated. (This message is rather generic). ror message is generated. (This message is rather generic). 5. Arrays an Epascal PACKED ARRAY declaration. The default lower bound is 1. cal PACKED ARRAY declaration. The default lower bound is 1. 6. Storage Classes words, if you don't specify COMMON or GLOBAL on an item, you get a TYPE declaration. If you do specify one of these get a TYPE declaration. If you do specify one of these 3-49 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE specified, the [EXTERNAL] attribute is added in either VAR case. If /GLOBALDEF is specified, the COMMON keyword generates an error message, and GLOBAL adds no Epascal attribute. error message, and GLOBAL adds no Epascal attribute. 7. ORIGIN However, if the origin of a record is specified as being other than its first field, it does cause a warning comment to be output to the Epascal source file to the effect that the structure has a negative origin. This is exactly the behavior of the PLI backend. rigin. This is exactly the behavior of the PLI backend. 8. Reserved Words underscore appended to the end. al reserved words have an underscore appended to the end. 9. Auxiliary Type Declarations auxiliary types: e Epascal Backend has to generate some auxiliary types: word or bit attribute. pes that are arrays or have the byte, word or bit attribute. pointer. sociated types that are one of the above or another pointer. These type names have the following form: module_name$$UBYTE for unsigne module_name$$WORD for words d bytes module_name$$UWORD for unsigne module_name$$TYPn for all other types module_name$$TYPn for all other types These type names are only generated if they are needed. 3-50 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE 3.1.8.9 ADA Translation Summary - 3.1.8.9 ADA Translation Summary - Declarati Declaration Ada Output IDENT string -- MODULE NAME IDENT string /* comment -- comment CONSTANT x EQUALS n; x : constant := n ; procedur parameter-list ... eter-list ); .. ); pragma INTERFACE (EXTERNAL, name); (name, "name", _PROCEDURE ( type,...) , ( type,...) .. meter-name : type; ANY UNSI DESCRIPTOR generates the DESCR passing mechanism name in the IMPORT_VALUED_PROCEDURE pragma for the parameter. URE pragma IN Causes the in param to appear on the formal mode parameter. to appear on the formal OUT appear on the formal parameter. NAMED param-name Parameter name. If none exists, names will be generated of the form PARAMETER_1 ... d of the PARAMETER_n. form PARAMETER_1 ... VALUE mechanism name in the IMPORT_VALUED_PROCEDURE pra for the parameter. URE pragma REFERENCE generates the REFERE mechanism name in the passing IMPORT_VALUED_PROCEDURE for the parameter. URE pragma DEFAULT value if DEFAULT 0, see th for the initial values of each w SDL data type. If the parameter contains the VALUE attribute and the default value is other than the default value is other than 3-51 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE the parameter. ue is added to OPTIONAL n/a arameter. TYPENAME type-name Speci datatype to be used as the parameter type. ed as the RETURNS data-type first parameter i parameter-list is the retu parameter. A comment of the f '-- return value' is placed rm along side the return parameter VARIABLE n/a side the return parameter. ALIAS internal-name n/a LINKAGE n/a TYPENAME type-name Speci datatype to be used as the en type. e to be used as the entry type. generated as well as a record representation clause and an initialization constant for the record. If any sub-struc- tures exist, the record types for those structures will be generated first. See the note below on structures for a dis- cussion of structure to Ada record translation. to Ada record translation. generated depending on t union. See the notes below for a discussion of union translations. n of union translations. WORD SHORT_INTEGER EGER LONGWORD INTEGER EGER QUADWORD UNSIGNED_ OCTAWORD UNSIGNED_LONGWORD_A BYTE UNSIGNED UNSIGNED_BYTE RD_ARRAY(0 .. 3) WORD UNSIGNED UNSIGNED_WORD LONGWORD UNSIGNED UNSIGNED_LONGWO QUADWORD UNSIGNED UNSIGNED_QUADWORD OCTAWORD UNSIGNED UNSIGNED_LONGWORD_A F_FLOATING FLOAT D_LONGWORD_ARRAY(0 .. 3) D_FLOATING D_FLOAT G_FLOATING G_FLOAT H_FLOATING LONG_LONG DECIMAL PRECISION (p,q) (this type has no implemented) A comment will appear in the output and a appear in the output and a 3-52 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE this effect. be printed to BITFIELD LENGTH n BOOLEAN (one b UNSIGNED_n (if leng MASK CONST prefixMname : constan 16#mask-value#; e : constant := SIGNED 16#mask-value#; BOOLEAN CHARACTER LENGTH n STRING(1 VARYING UNSIGNED_WORD fie string length will be generate if VARYING is specified. rated if VARYING is specified. ADDRESS ADDRESS Default storage class COMMON storage class n/a GLOBAL storage class n/a BASED pointer-name n/a just append '_ARRAY (lbound .. , hbound)' to the type. ound .. hbound)' to the type. be generated of the form will BIT_ARRAY(0 .. hbound*leng If lbound is not supplied, it defaults to 1. supplied, it ORIGIN member-name n/a lts to 1. ORIGIN member-name n/a Notes: Notes: 1. Ada names with underscores(_). llegal in ada names and are replaced with underscores(_). 2. Union criteria record type: s of the following form it is treated as a record type: ITEM_1 ...; a structure and the size of the first member is the same as the size of the union and e as the size of the union and 3-53 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE and the size of the first e member and the size of the first union. (Needed so size based on structure components is d correct.) e components is I_2_A ...; correct.) I_2_B ...; ... ...; end IT ITEM_3 ...; ... 3 ...; end A end A; used. se the union is ignored and only the first member is used. --------- Criteria are satisfied: --------- X_1 longword unsigned; X_2_OVERLAY union; d; X_2 longword uns X_2_FIELDS structure; X_2_B_1 byte unsign X_2_B_2 byte unsigned; end X_2_FIELDS; unsigned; X_2_C word unsign X_2_D structure; d; X_2_D_1 bitfie X_2_D_2 bitfield; ; end X_2_D; bitfield; end X_2_OVERLAY; end X; _2_OVERLAY; end X; above and would be treated as a record declaration. Something like the following would be generated: eclaration. Something like the following would be generated: X_2_B_1 : BYTE; record X_2_B_2 : BYTE; end record; E; end record; X_2_D_1 : FLAGS(1 .. 3); X_2_D_2 : BOOLEAN; 3); end record; LEAN; end record; X_1 : LONGWORD; rd X_1 : LONGWORD; 3-54 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE X_2 : XXX_X_2_TYPE; ---- 2_C overlaps X_2 ----X_ ----X_2_C : UNSIGNED_16; ---- 2_D overlaps X_2 ----X_ ----X_2_D : XXX_X_2_D_TYPE; end record; Exa --------- Criteria are not satisfied ------ Y_1 longword unsigned; Y_2_OVERLAY union; d; Y_2_A byte unsig Y_2_B byte unsigned; end Y_2_OVERLAY; igned; end Y; Y_2_OVERLAY; end Y; following would be generated: er is not a structure. The e generated: Y_1 : LONGWORD; rd Y_2_A : BYTE; Y_2_A : BYTE; ---- 2_B overlaps Y_2_A ----Y_ ----Y_2_B : BYTE; end record; 3. IN OUT parameter modes mode (in) will appear. given for a parameter, the default mode (in) will appear. 4. OPTIONAL parameters will be generated with and without the optional formal parameters. erated with and without the optional formal parameters. 5. Default values values for the initialization constant. nd the default Ada values for the initialization constant. 3-55 SDL LANGUAGE AND COMMAND REFERENCE SDL LANGUAGE AND COMMAND REFERENCE SDL TYPE Ada INITIALIZATION SDL TYPE Ada INITIALIZATION address ADDRESS_ZERO byte 0 char ASCII.NUL decimal NYI_PACKED_DECIMAL_ZERO double 0.0 float 0.0 g_float 0.0 d_float 0.0 longword 0 quadword (0, 0) octaword (0, 0, 0, 0) word 0 6. Structure to Ada Record Translation consists of three parts: 1) a record type definition 2) a record representation clause and 3) an initialization constant for the record. The three parts are of the form on constant for the record. The three parts are of the form end record; e-name is record member-name : type; ... end record; 0 .. size; ... end record for structure-name'size use total-size ; ... end record for structure-name'size use total-size (member-name => initial_value, ... ) tructure-name := (member-name => initial_value, ... ) is the size of the entire record in bits. , and total_size is the size of the entire record in bits. 3-56 CHAPTER 4 CHAPTER 4 EXAMPLES EXAMPLES 4.1 EXAMPLES 4.1.1 SDL Sour 4.1.1 SDL Source File Listing 4.1.1 SDL Source File Listing ULE $defopr ; #a CONSTANT operand_siz CONSTANT max_arguments EQUALS #ar CONSTANT max_arguments EQUALS #array_size; EM block_list_id ADDRESS GLOBAL; /* assign values to context identifiers CO bits, /* 0 bytes, /* 1 words, /* 2 longs, /* 3 quads, /* 4 octas /* 5 ) EQUALS 0 I EQUALS 0 INCREMENT 1 PREFIX ctx$; AG id WORD; erator STRUCTURE PREFIX opr$; count WORD size WORD; last_use WORD type BYTE UNSIG number BYTE UNSIGNED; opcode BYTE UNSIGNED; opbits STRUCTURE; D; variable_size bitfi size_units bitfield LENGTH offset_units bitfield LENGTH 3; "alias" bitfield; d LENGTH 3; END opbits; ield; argbits STRUC argbits STRUCTURE; 4-1 EXAMPLES EXAMPLES by_immed_ bitfield; by_ref_ bitfield; END argbits; ld; #opsize = .; operand WORD D END operator; MENSION 0:#array_size-1; ND operator; CO CONSTANT operator_size EQUALS #opsize/2; ; /* filled in by LEX PREFIX tok$ TAG "" common token_id LONGWORD; /* tok source_line LONGWORD; /* source token_length LONGWORD; /* length of token string en token_string CHARACTER LENGTH 1024; /* token strin CONSTANT size EQUALS .; /* token size * token string END; size EQUALS .; /* token size END; END_MODULE; MODULE externals; /* /* Get Job/Process Information system service LONGWORD UNSIGNED VALUE NAMED EFN TYPENAME EF LONGWORD UNSIGNED NAMED PIDADR IN OUT TYPENAME PROC CHARACTER DESCRIPTOR NAMED PRCNAM IN TYPENAME PROCNAME, ANY NAMED ITMLST IN TYPENAME ITEMLIST, ENAME PROCNAME, QUADWORD UNSIGNED NAMED IOSB OUT TYPENAM ADDRESS(ENTRY) NAMED ASTADR TYPENAME ASTADR, , LONGWORD UNSIGNED VALUE NAMED ASTPRM DEFAULT 0 ) RETURNS LONGWORD TYPENAME CONDVALU; FAULT 0 TYPENAME USERPARM ) RETURNS LONGWORD TYPENAME CONDVALU; END_MODULE; MODULE more_examples IDENT "V1.0"; /* C /* Example of Union terrupt Summary 2 CSR /* xample of Union AGG isum2 WORD UNSIGNED TAG" isum2_bits STRUCTURE PREFIX sgp$; rruptSummary2CSR fonterror BITFIELD MASK; /* FontError clipped BITFIELD MASK; /* Clipped r isum2_1 BITFIELD LENGTH 16-^ MASK; END isum2_bits; LENGTH 16-^ MASK; END isum2_word END isum2_word; 4-2 EXAMPLES EXAMPLES /* a /* n example with one of every data type AGG integer_types UNION; /* for fun, overlay signed and unsigned ypes signed_types STRUCTURE; /* signed datatypes nd unsigned one BYTE; /* byte datatype; signed datatypes two WORD; /* word datatype; three LONGWORD; /* a longword four QUADWORD; /* a quadword datatype five OCTAWORD; /* an octaword datatype END; CTAWORD; /* an octaword datatype uns uone BYTE UNSIGNED; UCTURE; /* unsigned data types utwo WORD UNSIGNED; uthree LONGWORD UNSIG ufour QUADWORD UNSIGNED; ufive OCTAWORD UNSIGNED; END; OCTAWORD UNSIGNED; END; f F_FL dg UNION DIMENSION 0:4; /* good pla d D_FLOATING; /* double floating ce for a union array g G_FLOATING; /* grand floating END; OATING; /* grand floating h H_FLO #p=10; #q=5; ; /* huge floating dec DECIMAL some_bits STRUCTURE; (#p,#q); /* packed decimal b1 BITFIELD MASK; /* b2 BITFIELD LENGTH 2 MASK; /* b3 BITFIELD MASK LENGTH 3; /* three bits END; FIELD MASK LENGTH 3; /* three bits truth B string CHARACTER LENGTH 32; vstring CHARACTER LENGTH 128 VARYING; /* characte p1 ADDRESS (LONGWORD); /* pointer to longword ter varying p2 ADDRESS (CHARACTER LENGTH 512 DIMENSION 2) ;/* pointer to char string array NSION 2) p3 ADDRESS (isum2_word); /* pointer t p4 ADDRESS; /* untyped pointer er to aggregate p5 ADDRESS (BYTE DIMENSION 8) DIM ;/* array of pointers to an array N 10 END one_of_each; inters to an array END one_of_each; /* Example of an implicit union with dimension first WORD; UCTURE WORD DIMENSION 3 PREFIX "tst$"; second WORD; third WORD; END fid; WORD; END fid; 4-3 EXAMPLES EXAMPLES END_MODULE more_examples; 4-4 EXAMPLES EXAMPLES 4.1.2 BLISS-32 (BLISSF) Output 4.1.2 BLISS-32 (BLISSF) Output !** literal operand_size = 1; literal max_arguments = 255 external block_list_id; 55; ! assign values to conte literal ctx$k_bits = 0; ! literal ctx$k_bytes = 1; ! 1 literal ctx$k_words = 2; ! 2 literal ctx$k_longs = 3; ! 3 literal ctx$k_quads = 4; ! 4 literal ctx$k_octas = 5; ! 5 literal opr$s_operand = 510; ! 5 FIELD opr$operator_FIELDSET = SET pr$operator_FIELDSET = opr$w opr$w_count = [2,0,16,1] opr$w_size = [4,0,16,1], opr$w_last_use = [6,0,16,1 opr$b_type = [8,0,8,0], 1], opr$b_number = [9,0,8,0], opr$b_opcode = [10,0,8,0], opr$v_variable_size = [11, opr$v_size_units = [11,1,3,0], , opr$v_offset_units = [11,4,3,0], opr$v_alias = [11,7,1,0], 3,0], opr$r_opbits = [11,0,8,0], opr$v_by_desc_ = [12,0,1,0 opr$v_by_immed_ = [12,1,1,0], opr$v_by_ref_ = [12,2,1,0], opr$r_argbits = [12,0,8,0], opr$w_operand = [13,0,0,1] TES; operand = [13,0,0,1] literal MACRO operator = BLOCK [opr$s_o literal operator_size = 6; s_operator,byte] FIELD (opr$operator_FIELDSET) %; literal tok$k_size = 1036; literal tok$s_token_string = 1024; ! token size FIELD tok$token_FIELDSET = SET ok$token_FIELDSET = ! filled in by LEX tok$l tok$l_source_line = [4,0,32,1], ! source lin tok$l_token_length = [8,0,32,1], ! length of token string ken tok$t_token_string = [12,0,0,0] ! token string n string TES; token_string = [12,0,0,0] ! token string literal MACRO token$TYPE = BLOCK [tok external token : token$TYPE; ! filled in by LEX FIELDSET) %; ernal token : token$TYPE; ! filled in by LEX !** ! Get Job/Process Informat ! Get Job/Process Information system service 4-5 EXAMPLES EXAMPLES ernal routine SYS$GETJPI; !** ! MODULE more_examples IDENT V1.0 *** ! C ! Example of Union terrupt Summary 2 CSR ! xample of Union lite literal sgp$m_clipped = 2; literal sgp$m_isum2_1 = 6553 FIELD isum2_word_FIELDSET = ; SET sum2_word_FIELDSET = isum2 sgp$v_fonterror = [0,0,1,0], ! FontError mmary2CSR sgp$v_clipped = [0,1,1,0], ! Clipped sgp$v_isum2_1 = [0,2,14,0], ! Clipped isum2_bits = [0,0,16,0] ,0], TES; bits = [0,0,16,0] literal MACRO isum2_word = BLOCK [s ! O isum2_word = BLOCK [s_isum2_word,byte] FIELD (isum2_word_FIELDSET) %; ! a ! n example with one of every data type lite literal sdl$m_b2 = 6; literal sdl$m_b3 = 56; literal sdl$s_integer_ty literal sdl$s_dg = 40; pes = 31; literal sdl$s_h = 16; literal sdl$s_dec = 6; literal sdl$s_string = 3 literal sdl$s_vstring = 130; literal sdl$s_p5 = 40; 130; FIELD sdl$one_of_each_FI SET dl$one_of_each_FIELDSET = ! show all data types s sdl$w_two = [1,0,16,1], ! word datatype; sdl$l_three = [3,0,32,1], ! a longword datat sdl$q_four = [7,0,0,0], ! a quadword datatype sdl$o_five = [15,0,0,0], ! an octaword datatype sdl$r_signed_types = [0,0,0,0], ! signed datatypes pe sdl$b_uone = [0,0,8,0], ,0], ! signed datatypes sdl$w_utwo = [1,0,16,0], sdl$l_uthree = [3,0,32,0], sdl$q_ufour = [7,0,0,0], sdl$o_ufive = [15,0,0,0], sdl$r_unsigned_types = [0,0,0 sdl$r_integer_types = [0,0,0,0], ! for fun, overlay sign sdl$f_f = [31,0,32,0], ! single floating signed and unsigned sdl$d_d = [35,0,0,0], ! double floating sdl$g_g = [35,0,0,0], ! grand floating sdl$r_dg = [35,0,0,0], ! good place for a sdl$h_h = [75,0,0,0], ! huge floating a union array sdl$h_h = [75,0,0,0], ! huge floating 4-6 EXAMPLES EXAMPLES sdl$v_b1 = [97,0,1,0], ! one bit cimal sdl$v_b2 = [97,1,2,0], ! two bits sdl$v_b3 = [97,3,3,0], ! three bits sdl$r_some_bits = [97,0,8,0], ! three bits sdl$b_truth = [98,0,8,0], sdl$t_string = [99,0,0,0], ! character sdl$t_vstring = [131,0,0,0], ! character varying sdl$a_p1 = [261,0,32,0], ! pointer to longword sdl$a_p2 = [265,0,32,0], ! pointer to char strin sdl$a_p3 = [269,0,32,0], ! pointer to aggregate array sdl$a_p4 = [273,0,32,0], ! untyped pointer ate sdl$a_p5 = [277,0,0,0] ! array of pointers TES; p5 = [277,0,0,0] ! array of pointers to an array literal MACRO one_of_each = BLOCK [sdl$s_o all data types h = BLOCK [sdl$s_one_of_each,byte] FIELD (sdl$one_of_each_FIELDSET) %; ! show ! Example of an literal tst$s_fid = 6; t union with dimension literal tst$s_fill_3 = 6 FIELD tst$fill_2_FIELDSET = SET st$fill_2_FIELDSET = w_fid tst$w_first = [0,0 tst$w_second = [2,0,16,1], tst$w_third = [4,0,16,1], TES; w_third = [4,0,16,1], literal MACRO fill_2 = BLOCK [tst$s MACRO fill_2 = BLOCK [tst$s_fill_2,byte] FIELD (tst$fill_2_FIELDSET) %; 4-7 EXAMPLES EXAMPLES 4.1.3 C Output 4.1.3 C Output /** #define operand_size 1 #define max_arguments 25 globalref int *block_list_i /* assign values to context ide #define ctx$k_bits 0 /* 0 */ #define ctx$k_bytes 1 /* 1 */ #define ctx$k_words 2 /* 2 */ #define ctx$k_longs 3 /* 3 */ #define ctx$k_quads 4 /* 4 */ #define ctx$k_octas 5 /* 5 */ struct operator { 5 /* 5 */ short int opr$w short int opr$w_count short int opr$w_size; short int opr$w_last_us unsigned char opr$b_type; unsigned char opr$b_number; unsigned char opr$b_opcode; struct { ar opr$b_opcode; unsigne unsigned opr$v_size_units : 3; ; unsigned opr$v_offset_units : 3; unsigned opr$v_alias : 1; : 3; } opr$r_opbits; ias : 1; struct { _opbits; unsigne unsigned opr$v_by_immed_ : 1; unsigned opr$v_by_ref_ : 1; unsigned opr$v_fill_0 : 5; } opr$r_argbits; l_0 : 5; short int opr$w_operan } ; int opr$w_operand [255]; #define o #define tok$k_size 1036 extern struct { /* filled in by LEX */ long int tok$l_token_id; /* token id */ long int tok$l_source_line; /* source line number of token */ long int tok$l_token_length; /* length of token string */ char tok$t_token_string [1024]; /* token string */ } token; _token_string [1024]; /* token string */ } token; /** /* Get Job/Process Informati long int SYS$GETJPI() ; ation system service */ g int SYS$GETJPI() ; /** /* /* CSR07 (+^o16) - Interrupt Summary 2 CSR */ /* Example of Union */ /* Example of Union */ 4-8 EXAMPLES EXAMPLES #define sgp$m_fonterror 1 */ #define sgp$m_clipped 2 #define sgp$m_isum2_1 655 union isum2_word { 1 65532 unsigned short i struct { ort int isum2; /* InterruptSummary2CSR */ unsigne unsigned sgp$v_clipped : 1; /* Clipped */ unsigned sgp$v_isum2_1 : 14; /* Clipped */ } isum2_bits; isum2_1 : 14; } ; isum2_bits; /* /* an example with one of every data type */ /* */ #define sdl$m_b1 1 */ #define sdl$m_b2 6 #define sdl$m_b3 56 struct one_of_each { union { /* for fun, overlay signed and unsigned struct { /* signed datatypes */ */ char sdl$b_one; /* byte datatype; */ short int sdl$w_two; /* word datatype; */ long int sdl$l_three; /* a longword datatype */ int sdl$q_four [2]; /* a quadword datatype */ int sdl$o_five [4]; /* an octaword datatype */ } sdl$r_signed_types; /* an octaword datatype */ struct { unsigned char sdl$b_uone; /* unsigned data types */ unsigned short int sdl$w_ut unsigned long int sdl$l_uthree; unsigned int sdl$q_ufour [2]; unsigned int sdl$o_ufive [4]; } sdl$r_unsigned_types; [4]; } sdl$r_integer_types; es; float sdl$f_f; union { /* good place for a union array */ double float sdl$d_d; /* double floating */ double float sdl$g_g; /* grand floating */ } sdl$r_dg [5]; g_g; /* grand floating */ int sdl$h_h [4]; char sdl$p_dec [6]; /* packed decimal */ struct { dec [6]; /* packed decimal */ unsigne unsigned sdl$v_b2 : 2; /* two bits */ unsigned sdl$v_b3 : 3; /* three bits */ unsigned sdl$v_fill_1 : 2; /* three bits */ } sdl$r_some_bits; 1 : 2; char sdl$b_truth; char sdl$t_string [32]; /* character string */ struct {short string_length; char string_text[128];} sdl$t_vstring; /* chara long int *sdl$a_p1; /* pointer to longword */ cter varying */ char (*sdl$a_p2) [512] [2]; /* pointer to char string array */ char (*sdl$a_p2) [512] [2]; /* pointer to char string array */ 4-9 EXAMPLES EXAMPLES int *sdl$a_p4; /* untyped pointer */ char (*sdl$a_p5 [10]) [8]; /* array of pointers to an array */ } ; (*sdl$a_p5 [10]) [8]; /* array of pointers to an array */ /* Exampl union fill_2 { implicit union with dimension */ short int w_ struct { _fid [3]; short i short int tst$w_second; short int tst$w_third; } tst$r_fill_3; hird; } ; tst$r_fill_3; } ; 4-10 EXAMPLES EXAMPLES 4.1.4 FORTRAN Output 4.1.4 FORTRAN Output !** PARAMETER operand_size = PARAMETER max_arguments = '000000FF'X INTEGER*4 block_list_id '000000FF'X ! assign values to contex PARAMETER ctx$k_bits = '00000000'X ! 0 PARAMETER ctx$k_bytes = '00000001'X ! 1 PARAMETER ctx$k_words = '00000002'X ! 2 PARAMETER ctx$k_longs = '00000003'X ! 3 PARAMETER ctx$k_quads = '00000004'X ! 4 PARAMETER ctx$k_octas = '00000005'X ! 5 STRUCTURE /operator/ = '00000005'X ! 5 INTEGER*2 opr$w_id INTEGER*2 opr$w_coun INTEGER*2 opr$w_size INTEGER*2 opr$w_last_u BYTE opr$b_type se BYTE opr$b_number BYTE opr$b_opcode PARAMETER opr$S_vari PARAMETER opr$V_variable_size = 0 PARAMETER opr$S_size_units = 3 0 PARAMETER opr$V_size_units = 1 PARAMETER opr$S_offset_units = 3 PARAMETER opr$V_offset_units = 4 PARAMETER opr$S_alias = 1 s = 4 PARAMETER opr$V_alias = 7 BYTE %FILL (1) alias = 7 PARAMETER opr$S_ PARAMETER opr$V_by_desc_ = 0 PARAMETER opr$S_by_immed_ = 1 PARAMETER opr$V_by_immed_ = 1 PARAMETER opr$S_by_ref_ = 1 PARAMETER opr$V_by_ref_ = 2 INTEGER*2 opr$w_operand(0:254) BYTE %FILL (1) r$w_operand(0:254) END STRUCTURE ! PARAMETER operator_size = PARAMETER tok$k_size = '0000040C'X ! t STRUCTURE /token/ ! filled in by LEX en size INTEGER*4 tok$l_token_id ! token id INTEGER*4 tok$l_source_line ! source INTEGER*4 tok$l_token_length ! length of token string en CHARACTER*1024 tok$t_token_string ! token string ring END STRUCTURE ! token t_token_string ! token string RECORD /token/ token COMMON /token/ token MMON /token/ token !** ! Get Job/Process Informat ! Get Job/Process Information system service 4-11 EXAMPLES EXAMPLES EXTERNAL SYS$GETJPI TERNAL SYS$GETJPI !** ! MODULE more_examples IDENT V1.0 *** ! C ! Example of Union terrupt Summary 2 CSR ! xample of Union PAR PARAMETER sgp$m_clipped = '00000002'X PARAMETER sgp$m_isum2_1 = '0000FFFC'X STRUCTURE /isum2_word/ = '0000FFFC'X UNION RE /isum2_word/ MAP INTEG END MAP isum2 ! InterruptSummary2CSR MAP AP P PARAMETER sgp$V_fonterror = 0 PARAMETER sgp$S_clipped = 1 ! FontError PARAMETER sgp$V_clipped = 1 PARAMETER sgp$S_isum2_1 = 14 Clipped PARAMETER sgp$V_isum2_1 = 2 BYTE %FILL (2) isum2_1 = 2 END MAP %FILL (2) END UNION END STRUCTU ! STRUCTURE ! isum2_word ! a ! n example with one of every data type PAR PARAMETER sdl$m_b2 = '00000006'X PARAMETER sdl$m_b3 = '00000038'X STRUCTURE /one_of_each/ ! show UNION one_of_each/ ! show all data types MAP B INTEGER*2 sdl$w_two ! word datatype; INTEGER*4 sdl$l_three ! a longword dat INTEGER*4 sdl$q_four(2) ! a quadword datatype INTEGER*4 sdl$o_five(4) ! an octaword datatype END MAP ER*4 sdl$o_five(4) ! an octaword datatype MAP AP B INTEGER*2 sdl$w_utwo INTEGER*4 sdl$l_uthree INTEGER*4 sdl$q_ufour(2) INTEGER*4 sdl$o_ufive(4) END MAP ER*4 sdl$o_ufive(4) END UNION REAL*4 s UNION sdl$f_f ! single floating MAP MAP 4-12 EXAMPLES EXAMPLES END MAP sdl$d_d ! double floating MAP AP REAL* END MAP sdl$g_g ! grand floating END UNION REAL*16 s BYTE sdl$p_dec(6) ! packed dec PARAMETER sdl$S_b1 = 1 packed decimal PARAMETER sdl$V_b1 = 0 PARAMETER sdl$S_b2 = 2 ! one bit PARAMETER sdl$V_b2 = 1 PARAMETER sdl$S_b3 = 3 ! two bits PARAMETER sdl$V_b3 = 3 BYTE sdl$b_truth ! boolean e bits CHARACTER*32 sdl$t_string ! charac STRUCTURE /sdl$t_vstring/ sdl$t_vstring tring INTEGER*2 LEN tring/ sdl$t_vstring CHARACTER*128 T END STRUCTURE 28 TXT ! character varying INTEGER*4 sdl$a_p INTEGER*4 sdl$a_p2 ! pointer to char strin INTEGER*4 sdl$a_p3 ! pointer to aggregate array INTEGER*4 sdl$a_p4 ! untyped pointer ate INTEGER*4 sdl$a_p5(1:10) ! array of poi BYTE %FILL (1) l$a_p5(1:10) ! array of pointers to an array END STRUCTURE ! ! Example of an implicit unio STRUCTURE /fill_2/ icit union with dimension UNION RE /fill_2/ MAP INTEG END MAP w_fid(1:3) MAP AP I INTEGER*2 tst$w_second INTEGER*2 tst$w_third END MAP ER*2 tst$w_third END UNION END STRUCTU END STRUCTURE ! fill_2 4-13 EXAMPLES EXAMPLES 4.1.5 MACRO-32 Output 4.1.5 MACRO-32 Output .M operand_size'..equ'1 <=>,..COL=<:> max_arguments'..equ'25 .GLOBL block_list_id ; block_list_id'..equ'0 ; assign values to conte ctx$k_bits'..equ'0 ; ctx$k_bytes'..equ'1 ; 1 ctx$k_words'..equ'2 ; 2 ctx$k_longs'..equ'3 ; 3 ctx$k_quads'..equ'4 ; 4 ctx$k_octas'..equ'5 ; 5 opr$S_operator'..equ'523 ; 5 operator'..equ'0 qu'523 opr$w_id'..equ'0 opr$w_count'..equ' opr$w_size'..equ'4 opr$w_last_use'..equ opr$b_type'..equ'8 '6 opr$b_number'..equ'9 opr$b_opcode'..equ'10 opr$S_opbits'..equ'1 opr$r_opbits'..equ'11 opr$v_variable_size'..e opr$S_size_units'..equ'3 0 opr$v_size_units'..equ'1 opr$S_offset_units'..equ'3 opr$v_offset_units'..equ'4 opr$v_alias'..equ'7 equ'4 opr$S_argbits'..equ'1 opr$r_argbits'..equ'12 opr$v_by_desc_'..equ'0 opr$v_by_immed_'..equ'1 opr$v_by_ref_'..equ'2 opr$S_operand'..equ'510 opr$w_operand'..equ'13 operator_size'..equ'6 tok$k_size'..equ'1036 .SAVE ze'..equ'1036 ; token size .PSECT token'..col' .blkb 1036 ,GBL,SHR,NOEXE,RD,WRT,LONG .RESTORE ' .blkb 1036 tok$S_token ; token'..equ'0 tok$l_token_id'..equ'0 ; token id by LEX tok$l_source_line'..equ'4 ; source lin tok$l_token_length'..equ'8 ; length of token string ken tok$S_token_string'..equ'1024 ; length of token string tok$t_token_string'..equ'12 .ENDM ken_string'..equ'12 ; token string .ENDM 4-14 EXAMPLES EXAMPLES .M ; Get Job/Process Information system s ; External entry SYS$GETJPI n system service .ENDM al entry SYS$GETJPI NDM .M ; CRO more_examples,..EQU=<=>,..COL=<:> ; IDENT V1.0 ; C ; Example of Union terrupt Summary 2 CSR ; xample of Union sgp$ sgp$m_clipped'..equ'2 sgp$m_isum2_1'..equ'655 S_isum2_word'..equ'2 532 isum2_word'..equ'0 isum2'..equ'0 sgp$S_isum2_bits'..equ'2 ; InterruptSummary2CSR isum2_bits'..equ'0 qu'2 sgp$v_fonterror'..eq sgp$v_clipped'..equ'1 ; Clipped sgp$S_isum2_1'..equ'14 ; Clipped sgp$v_isum2_1'..equ'2 ; v_isum2_1'..equ'2 ; a ; n example with one of every data type sdl$ sdl$m_b2'..equ'6 sdl$m_b3'..equ'56 sdl$S_one_of_each'. one_of_each'..equ'0 sdl$S_integer_types'..equ'31 ; show all data types sdl$r_integer_types'..equ'0 sdl$S_signed_types'..equ'31 ; for fun, overlay signed and unsigned sdl$r_signed_types'..equ'0 sdl$b_one'..equ'0 ; byte datatype; sdl$w_two'..equ'1 ; word datatype; sdl$l_three'..equ'3 ; a longword datat sdl$S_four'..equ'8 ; a longword datatype sdl$q_four'..equ'7 sdl$S_five'..equ'16 ; a quadword datatype sdl$o_five'..equ'15 sdl$S_unsigned_types'..equ'31 ; an octaword datatype sdl$r_unsigned_types'..equ'0 sdl$b_uone'..equ'0 '..equ'0 ; unsigned data types sdl$w_utwo'..equ'1 sdl$l_uthree'..equ'3 sdl$S_ufour'..equ'8 sdl$q_ufour'..equ'7 sdl$S_ufive'..equ'16 sdl$o_ufive'..equ'15 sdl$f_f'..equ'31 sdl$S_dg'..equ'40 ; single floating sdl$S_dg'..equ'40 4-15 EXAMPLES EXAMPLES sdl$S_d'..equ'8 ; good place for a union array sdl$d_d'..equ'35 sdl$S_g'..equ'8 ; double floating sdl$g_g'..equ'35 sdl$S_h'..equ'16 ; grand floating sdl$h_h'..equ'75 sdl$S_dec'..equ'6 ; huge floating sdl$p_dec'..equ'91 sdl$S_some_bits'..equ'1 ; packed decimal sdl$r_some_bits'..equ'97 sdl$v_b1'..equ'0 sdl$S_b2'..equ'2 ; one bit sdl$v_b2'..equ'1 sdl$S_b3'..equ'3 ; two bits sdl$v_b3'..equ'3 sdl$b_truth'..equ'98 ; boolean s sdl$S_string'..equ'32 ; boolean sdl$t_string'..equ'99 sdl$S_vstring'..equ'130 ; character string sdl$t_vstring'..equ'131 sdl$a_p1'..equ'261 ; pointer to longword sdl$a_p2'..equ'265 ; pointer to char strin sdl$a_p3'..equ'269 ; pointer to aggregate array sdl$a_p4'..equ'273 ; untyped pointer ate sdl$S_p5'..equ'40 ; untyped pointer sdl$a_p5'..equ'277 ; Example of an implicit union with dimension of pointers to an array tst$S_fid'..equ'6 plicit union with dimension w_fid'..equ'0 '6 tst$w_first'..e tst$w_second'..equ'2 tst$w_third'..equ'4 .ENDM ird'..equ'4 .ENDM 4-16 EXAMPLES EXAMPLES 4.1.6 PL/I Output 4.1.6 PL/I Output /** %REPLACE operand_size BY 1 %REPLACE max_arguments BY 255 DCL block_list_id pointer GLOBAL /* assign values to context identifiers %REPLACE ctx$k_bits BY 0; /* 0 */ %REPLACE ctx$k_bytes BY 1; /* 1 */ %REPLACE ctx$k_words BY 2; /* 2 */ %REPLACE ctx$k_longs BY 3; /* 3 */ %REPLACE ctx$k_quads BY 4; /* 4 */ %REPLACE ctx$k_octas BY 5; /* 5 */ PLACE ctx$k_octas BY 5; /* 5 */ %RE DCL 1 operator BASED , Y 523; 2 opr$w_id fixed bin 2 opr$w_count fixed binary(15) 2 opr$w_size fixed binary(15), 2 opr$w_last_use fixed binary(15 2 opr$b_type bit(8) aligned, 15), 2 opr$b_number bit(8) aligned, 2 opr$b_opcode bit(8) aligned, 2 opr$r_opbits , (8) aligned, 3 opr$v_variable_ 3 opr$v_size_units bit(3), , 3 opr$v_offset_units bit(3), 3 opr$v_alias bit(1), t(3), 2 opr$r_argbits , 1), 3 opr$v_by_desc_ b 3 opr$v_by_immed_ bit(1), 3 opr$v_by_ref_ bit(1), 3 opr$v_fill_0 bit(5), 2 opr$w_operand (0:254) f %REPLACE operator_size BY 6; ixed binary(15); %REPLACE tok$k_size BY 1036; PLACE tok$k_size BY 1036; /* token size */ %RE DCL 1 token STATIC EXTERNAL , 2 tok$l_token_id fixed binary(31), /* token id */ 2 tok$l_source_line fixed binary(31), /* source line number of token */ 2 tok$l_token_length fixed binary(31), /* length of token string */ 2 tok$t_token_string character(1024); /* token string */ 2 tok$t_token_string character(1024); /* token string */ /** /* Get Job/Process Informati DCL SYS$GETJPI ENTRY ( mation system service */ bit(32) aligned VALUE , bit(32) aligned, LUE , character(*), , any, ter(*), bit(64 bit(64) aligned, 4-17 EXAMPLES EXAMPLES bit(32) al ) (32) aligned VALUE RET TURNS (fixed binary(31)); /** /* /* CSR07 (+^o16) - Interrupt Summary 2 CSR */ /* Example of Union */ /* */ %REPLACE sgp$m_fonterror BY '10000000000000000000000000000000'b; */ %REPLACE sgp$m_clipped BY '01000000000000000000000000000000'b; %REPLACE sgp$m_isum2_1 BY '00111111111111110000000000000000'b; PLACE sgp$m_isum2_1 BY '00111111111111110000000000000000'b; %RE DCL 1 isum2_word union BASED 2 isum2 bit(16) aligned, 2 isum2_bits , aligned, /* InterruptSummary2CSR */ 3 sgp$v_fonterr 3 sgp$v_clipped bit(1), /* Clipped */ 3 sgp$v_isum2_1 bit(14); /* Clipped */ /* /* an example with one of every data type */ /* */ %REPLACE sdl$m_b1 BY '10000000000000000000000000000000'b; */ %REPLACE sdl$m_b2 BY '01100000000000000000000000000000'b; %REPLACE sdl$m_b3 BY '00011100000000000000000000000000'b; PLACE sdl$m_b3 BY '00011100000000000000000000000000'b; %RE DCL 1 one_of_each BASED , 2 sdl$r_integer_types union, /* for fun, overlay signed and unsigned 3 sdl$r_signed_types , /* signed datatypes */ */ 4 sdl$b_one fixed binary(7), /* byte datatype; */ 4 sdl$w_two fixed binary(15), /* word datatype; */ 4 sdl$l_three fixed binary(31), /* a longword datatype */ 4 sdl$q_four bit (64) aligned, /* a quadword datatype */ 4 sdl$o_five bit (128) aligned, /* an octaword datatype */ 3 sdl$r_unsigned_types , /* unsigned data types */ 4 sdl$b_uone bit(8) aligned, /* unsigned data types */ 4 sdl$w_utwo bit(16) aligned, 4 sdl$l_uthree bit(32) aligned, 4 sdl$q_ufour bit(64) aligned, 4 sdl$o_ufive bit(128) aligned, 2 sdl$f_f float binary(24), 2 sdl$r_dg (0:4) union, /* good place for a union array */ 3 sdl$d_d float binary(53), /* double floating */ 3 sdl$g_g float binary(53), /* grand floating */ 2 sdl$h_h float binary(113), /* huge floating */ 2 sdl$p_dec fixed decimal(10,5), /* packed decimal */ 2 sdl$r_some_bits , imal(10,5), /* packed decimal */ 3 sdl$v_b1 bit(1), 3 sdl$v_b2 bit(2), /* two bits */ 3 sdl$v_b3 bit(3), /* three bits */ 3 sdl$v_b3 bit(3), /* three bits */ 4-18 EXAMPLES EXAMPLES 2 sdl$b_truth bit(1) alig 2 sdl$t_string character(32), /* character string */ 2 sdl$t_vstring character(128) VARYING , /* character varying */ 2 sdl$a_p1 pointer, /* pointer to longword */ 2 sdl$a_p2 pointer, /* pointer to char string array */ 2 sdl$a_p3 pointer, /* pointer to aggregate */ 2 sdl$a_p4 pointer, /* untyped pointer */ 2 sdl$a_p5 (1:10) pointer; /* array of pointers to an array */ /* Example of an implicit union with dimension */ Example of an implicit union with dimension */ %RE DCL 1 fill_2 union BASED , 2 w_fid (1:3) fixed bin 2 tst$r_fill_3 , d binary(15), 3 tst$w_first fix 3 tst$w_second fixed binary(15), 3 tst$w_third fixed binary(15); 3 tst$w_third fixed binary(15); 4-19 EXAMPLES EXAMPLES 4.1.7 PASCAL Output 4.1.7 PASCAL Output MOD ULE SDLEXAM ; [HI $BYTE = [BYTE] -128..127; ared data types ****) $WORD = [WORD] -32768..3276 $QUAD = [QUAD,UNSAFE] RECORD L0:UNSIGNED; L1:INTEGER; END; $OCTA = [OCTA,UNSAFE] RECORD L0,L1,L2:UNSIGNED; L3:INTEGER $UBYTE = [BYTE] 0..255; TEGER; END; $UWORD = [WORD] 0..65535; $UQUAD = [QUAD,UNSAFE] RECO L0,L1:UNSIGNED; END; RECORD $UOCTA = [OCTA,UNSAFE] L0,L1,L2,L3:UNSIGNED; END; $PACKED_DEC = [BIT(4),UNSAFE] $DEFTYP = [UNSAFE] INTEGER; 0..15; $DEFPTR = [UNSAFE] ^$DEFTYP; $BOOL = [BIT(1),UNSAFE] BOOLEA $BIT2 = [BIT(2),UNSAFE] 0..3; ; $BIT3 = [BIT(3),UNSAFE] 0..7; $BIT4 = [BIT(4),UNSAFE] 0..15; $BIT5 = [BIT(5),UNSAFE] 0..31; $BIT6 = [BIT(6),UNSAFE] 0..63; $BIT7 = [BIT(7),UNSAFE] 0..127; $BIT8 = [BIT(8),UNSAFE] 0..255; $BIT9 = [BIT(9),UNSAFE] 0..511; $BIT10 = [BIT(10),UNSAFE] 0..1023 $BIT11 = [BIT(11),UNSAFE] 0..2047; $BIT12 = [BIT(12),UNSAFE] 0..4095; $BIT13 = [BIT(13),UNSAFE] 0..8191; $BIT14 = [BIT(14),UNSAFE] 0..16383; $BIT15 = [BIT(15),UNSAFE] 0..32767; $BIT16 = [BIT(16),UNSAFE] 0..65535; $BIT17 = [BIT(17),UNSAFE] 0..131071; $BIT18 = [BIT(18),UNSAFE] 0..262143; $BIT19 = [BIT(19),UNSAFE] 0..524287; $BIT20 = [BIT(20),UNSAFE] 0..1048575; $BIT21 = [BIT(21),UNSAFE] 0..2097151; $BIT22 = [BIT(22),UNSAFE] 0..4194303; $BIT23 = [BIT(23),UNSAFE] 0..8388607; $BIT24 = [BIT(24),UNSAFE] 0..16777215; $BIT25 = [BIT(25),UNSAFE] 0..33554431; $BIT26 = [BIT(26),UNSAFE] 0..67108863; $BIT27 = [BIT(27),UNSAFE] 0..134217727; $BIT28 = [BIT(28),UNSAFE] 0..268435455; $BIT29 = [BIT(29),UNSAFE] 0..536870911; $BIT30 = [BIT(30),UNSAFE] 0..1073741823; $BIT31 = [BIT(31),UNSAFE] 0..2147483647; $BIT32 = [BIT(32),UNSAFE] UNSIGNED; 47; $BIT32 = [BIT(32),UNSAFE] UNSIGNED; 4-20 EXAMPLES EXAMPLES (** * MODULE $defopr ***) CON max_arguments = 255; x_arguments = 255; VAR block_list_id :[EXTERNAL] $DEFPTR; (* assign values to context identifiers *) CON ctx$k_bytes = 1; (* 1 *) *) ctx$k_words = 2; (* 2 *) ctx$k_longs = 3; (* 3 *) ctx$k_quads = 4; (* 4 *) ctx$k_octas = 5; (* 5 *) x$k_octas = 5; (* 5 *) TYP 1: (opr$w_id : $WORD; ASE INTEGER OF opr$w_count : $WORD opr$w_size : $WORD; opr$w_last_use : $WOR opr$b_type : $UBYTE; ; opr$b_number : $UBYTE; opr$b_opcode : $UBYTE; opr$r_opbits : [BYTE(1)] opr$r_argbits : [BYTE(1)] RECORD END; opr$w_operand : ARRAY [0..254] OF $WORD ); w_operand : ARRAY [0..254] OF $WORD; 2: (opr$ opr$v_size_units : [POS(89)] $BIT3; ; opr$v_offset_units : [POS(92)] $BIT3; opr$v_alias : [POS(95)] $BOOL; BIT3; opr$v_by_desc_ : [POS(96)] $BOOL opr$v_by_immed_ : [POS(97)] $BOOL; opr$v_by_ref_ : [POS(98)] $BOOL; ) $v_by_ref_ : [POS(98)] $BOOL; END; D; CON tok$k_size = 1036; k$k_size = 1036; (* token size *) VAR tok$l_token_id : INTEGER; (* token id *) ) tok$l_source_line : INTEGER; (* source line number of token *) tok$l_token_length : INTEGER; (* length of token string *) tok$t_token_string : PACKED ARRAY [1..1024] OF CHAR; (* token string END; k$t_token_string : PACKED ARRAY [1..1024] OF CHAR; (* token string *) D; (** * MODULE externals ***) (* Get Job/Process Information system service *) 4-21 EXAMPLES EXAMPLES %IMMED EFN : UNSIGNED; S$GETJPI)] FUNCTION $GETJPI ( VAR PIDADR : [VOLATILE]U PRCNAM : [CLASS_S] PACKED ARRAY [$ %REF ITMLST : [UNSAFE] ARRAY [$l4..$u4:INTEGER] OF $UBYTE; VAR IOSB : [VOLATILE]$UQUAD; $l4..$u4:INTEGER] OF $UBYTE; %IMMED [UNBOUND, ASYNCHRONOUS] %IMMED ASTPRM : UNSIGNED := %IMMED 0) : INTEGER; E MMED ASTPRM : UNSIGNED := %IMMED 0) : INTEGER; EXTERNAL; (** * MODULE more_examples IDENT V1.0 ***) [HI more_examples$$typ1 = [UNSAFE] ARRAY [1..2] OF PACK more_examples$$typ2 = [UNSAFE] ARRAY [1..8] OF $BYTE; RRAY [1..512] OF CHAR; re_examples$$typ2 = [UNSAFE] ARRAY [1..8] OF $BYTE; (* (* CSR07 (+^o16) - Interrupt Summary 2 CSR *) (* Example of Union *) (* *) *) CON sgp$m_clipped = 2; = 1; sgp$m_isum2_1 = 6553 p$m_isum2_1 = 65532; TYP 1: (isum2 : $UWORD; (* Interr ); 2 : $UWORD; (* InterruptSummary2CSR *) 2: (isum ); 2_bits : [BYTE(2)] RECORD END; 3: (sgp$ sgp$v_clipped : [POS(1)] $BOOL; (* Clipped *) sgp$v_isum2_1 : [POS(2)] $BIT14; Clipped *) ) $v_isum2_1 : [POS(2)] $BIT14; END; D; (* (* an example with one of every data type *) (* *) *) CON sdl$m_b2 = 6; 1; sdl$m_b3 = 56; l$m_b3 = 56; TYP 1: (sdl$r_integer_types : [BYTE(31)] RECORD END; (* for fun, overlay signed sdl$f_f : SINGLE; (* single floating *) ned and unsigned *) sdl$r_dg : [BYTE(40)] RECORD END; (* good place for a union array *) sdl$h_h : QUADRUPLE; (* huge floating *) sdl$p_dec : PACKED ARRAY [1..11] OF $PACKED_DEC; (* packed decimal * sdl$r_some_bits : [BYTE(1)] RECORD END; ED_DEC; (* packed decimal *) sdl$b_truth : BOOLEAN; (* boolean sdl$t_string : PACKED ARRAY [1..32] OF CHAR; (* character string *) sdl$t_string : PACKED ARRAY [1..32] OF CHAR; (* character string *) 4-22 EXAMPLES EXAMPLES sdl$a_p1 : ^INTEGER; (* pointer to longword *) sdl$a_p2 : ^more_examples$$typ1; (* pointer to char string array *) sdl$a_p3 : ^isum2_word ; (* pointer to aggregate *) sdl$a_p4 : $DEFPTR; (* untyped pointer *) sdl$a_p5 : ARRAY [1..10] OF ^more_examples$$typ2; (* array of pointe ); a_p5 : ARRAY [1..10] OF ^more_examples$$typ2; (* array of pointers to an array *) 2: (sdl$ sdl$d_d : DOUBLE; (* double floating *) pes *) sdl$v_b1 : [POS(776)] $BOOL; (* one bit *) sdl$v_b2 : [POS(777)] $BIT2; (* two bits *) sdl$v_b3 : [POS(779)] $BIT3; (* three bits *) ); v_b3 : [POS(779)] $BIT3; (* three bits *) 3: (sdl$ sdl$w_two : $WORD; (* word datatype; *) sdl$l_three : INTEGER; (* a longword datatype *) sdl$q_four : $QUAD; (* a quadword datatype *) sdl$o_five : $OCTA; (* an octaword datatype *) sdl$g_g : DOUBLE; (* grand floating *) ); g_g : DOUBLE; (* grand floating *) 4: (sdl$ ); r_unsigned_types : [POS(0), BYTE(31)] RECORD END; (* unsigned data types *) 5: (sdl$ sdl$w_utwo : $UWORD; sdl$l_uthree : UNSIGNE sdl$q_ufour : $UQUAD; ; sdl$o_ufive : $UOCTA; ) $o_ufive : $UOCTA; END; D; (* Example of an implicit union with dimension *) TYP 1: (w_fid : ARRAY [1..3] OF $WORD; ); d : ARRAY [1..3] OF $WORD; 2: (tst$ ); r_fill_3 : [BYTE(6)] RECORD END; 3: (tst$ tst$w_second : $WORD; tst$w_third : $WORD; ) $w_third : $WORD; END; D; END END. 4-23 EXAMPLES EXAMPLES 4.1.8 DATATRIEVE Output 4.1.8 DATATRIEVE Output OTE: All dollar-signs ($) appearing in names have been replaced by hyphens (-) ! * ! operand_size=1 pr *** ! max_arguments=25 ax_arguments=255 DEF 1 block_list_id USAGE IS LONG. ; USING ! assign values to context identifi ! ctx$k_bits=0 ! ! ctx$k_bytes=1 ! 1 ! ctx$k_words=2 ! 2 ! ctx$k_longs=3 ! 3 ! ctx$k_quads=4 ! 4 ! ctx$k_octas=5 ! 5 tx$k_octas=5 ! 5 DEF 1 operator . perator_RECORD USING 2 opr-w_id US 2 opr-w_count USAGE IS WORD 2 opr-w_size USAGE IS WORD. 2 opr-w_last_use USAGE IS WOR 2 opr-b_type USAGE IS BYTE. D. 2 opr-b_number USAGE IS BYTE. 2 opr-b_opcode USAGE IS BYTE. 2 opr-r_opbits USAGE IS BYTE . ! opr$v_variable_size BIT 0:1 ! opr$v_size_units BIT 1:3 1 ! opr$v_offset_units BIT 4:3 ! opr$v_alias BIT 7:1 T 4:3 2 opr-r_argbits USAGE IS ! opr$v_by_desc_ BIT 0:1 TE . ! opr$v_by_immed_ BIT 1:1 ! opr$v_by_ref_ BIT 2:1 ! opr$v_fill_0 BIT 3:5 2 opr-w_operand USAGE IS ! operator_size=6 SAGE IS WORD OCCURS 255 TIMES . ; ! tok$k_size=1036 ok$k_size=1036 ! token size DEF 1 token . 2 tok-l_token_id USAGE IS LONG. ! token id by LEX 2 tok-l_source_line USAGE IS LONG. ! source lin 2 tok-l_token_length USAGE IS LONG. ! length of token string ken 2 tok-t_token_string PIC X(1024). ; ! token string n string tok-t_token_string PIC X(1024). ; ! token string ! * ! Get Job/Process Informatio ! SYS$GETJPI ENTRY ormation system service YS$GETJPI ENTRY ! * ! *** MODULE more_examples IDENT V1.0 *** 4-24 EXAMPLES EXAMPLES ! C ! Example of Union terrupt Summary 2 CSR ! xample of Union ! s ! sgp$m_clipped=2 ! sgp$m_isum2_1=655 gp$m_isum2_1=65532 DEF 1 isum2_word . m2_word_RECORD USING 2 isum2 USAGE I 2 isum2_bits REDEFINES isum2 USAGE IS WORD . uptSummary2CSR ! sgp$v_fonterror BIT 0:1 ! FontE ! sgp$v_clipped BIT 1:1 ! Clipped ! sgp$v_isum2_1 BIT 2:14 ! Clipped ; sgp$v_isum2_1 BIT 2:14 ! ! a ! n example with one of every data type ! s ! sdl$m_b2=6 ! sdl$m_b3=56 dl$m_b3=56 DEF 1 one_of_each . ! 2 sdl-r_integer_types . ! for fun, overlay sign 3 sdl-r_signed_types . ! signed datatypes igned and unsigned 4 sdl-b_one USAGE IS BYTE. ! byte datatype; 4 sdl-w_two USAGE IS WORD. ! word datatype; 4 sdl-l_three USAGE IS LONG. ! a longword datat 4 sdl-q_four USAGE IS QUAD. ! a quadword datatype 4 sdl-o_five USAGE IS QUAD OCCURS 2 TIMES . ! an octaword d 3 sdl-r_unsigned_types REDEFINES sdl-r_signed_types . ! unsigned data 4 sdl-b_uone USAGE IS BYTE. ES sdl-r_signed_types . ! unsigned data types 4 sdl-w_utwo USAGE IS WORD. 4 sdl-l_uthree USAGE IS LONG. 4 sdl-q_ufour USAGE IS QUAD. 4 sdl-o_ufive USAGE IS QUAD OC 2 sdl-f_f USAGE IS REAL. ! single f 2 sdl-r_dg OCCURS 5 TIMES . ! good place for a 3 sdl-d_d USAGE IS DOUBLE. ! double floating union array 3 sdl-g_g REDEFINES sdl-d_d USAGE IS DOUBLE. ! grand flo 2 sdl-h_h USAGE IS QUAD OCCURS 2 TIMES . ! huge floating ting 2 sdl-p_dec USAGE IS PACKED PIC S9(5)V9(5). ! packed decim 2 sdl-r_some_bits USAGE IS BYTE . 5)V9(5). ! packed decimal ! sdl$v_b1 BIT 0:1 ! sdl$v_b2 BIT 1:2 ! two bits ! sdl$v_b3 BIT 3:3 ! three bits ! sdl$v_fill_1 BIT 6:2 ! three bits 2 sdl-b_truth USAGE IS BY 2 sdl-t_string PIC X(32). ! character 2 sdl-t_vstring . X(32). ! character string 3 STRING_LENGTH US 3 STRING_LENGTH USAGE IS WORD. 4-25 EXAMPLES EXAMPLES 2 sdl-a_p1 USAGE IS LONG. ! pointer to longword 2 sdl-a_p2 USAGE IS LONG. ! pointer to char strin 2 sdl-a_p3 USAGE IS LONG. ! pointer to aggregate array 2 sdl-a_p4 USAGE IS LONG. ! untyped pointer ate 2 sdl-a_p5 USAGE IS LONG OCCURS 10 TIMES . ; ! array of p ! Example of an implicit union with dimension ! array of pointers to an array xample of an implicit union with dimension DEF 1 fill_2 . fill_2_RECORD USING 2 w_fid USA 2 tst-r_fill_3 REDEFINES w_fid . ES . 3 tst-w_first USAGE IS WORD. . 3 tst-w_second USAGE IS WORD. 3 tst-w_third USAGE IS WORD. ; 3 tst-w_third USAGE IS WORD. ; 4-26 EXAMPLES EXAMPLES 4.1.9 ELN Pascal Output 4.1.9 ELN Pascal Output {** MODULE $defopr **} CON max_arguments = 255; x_arguments = 255; VAR block_list_id : [EXTERNAL] ^ANYTYPE; { a ssign values to context identifiers } CON ctx$k_bytes = 1; { 1 } } ctx$k_words = 2; { 2 } ctx$k_longs = 3; { 3 } ctx$k_quads = 4; { 4 } ctx$k_octas = 5; { 5 } x$k_octas = 5; { 5 } TYP 1 : (opr$w_id : [WORD] -32768..32767; ER OF opr$w_count : [WORD] -32768..32767; opr$w_size : [WORD] -32768..32767; opr$w_last_use : [WORD] -32768..3276 opr$b_type : [BYTE] 0..255; 8..32767; opr$b_number : [BYTE] 0..255; opr$b_opcode : [BYTE] 0..255; opr$r_opbits : BYTE_DATA(1); opr$r_argbits : BYTE_DATA(1); opr$w_operand : PACKED ARRAY[0. ); w_operand : PACKED ARRAY[0..254] OF [WORD] -32768..32767; 2 : (opr opr$v_size_units : [POS(89),BIT(3)] 0..7; opr$v_offset_units : [POS(92),BIT(3)] 0..7; opr$v_alias : [POS(95)] BOOLEAN; 3)] 0..7; opr$v_by_desc_ : [POS(96)] BOOLEAN opr$v_by_immed_ : [POS(97)] BOOLEAN; opr$v_by_ref_ : [POS(98)] BOOLEAN; ) $v_by_ref_ : [POS(98)] BOOLEAN; END; D; CON tok$k_size = 1036; k$k_size = 1036; { token size } VAR tok$l_token_id : INTEGER; { token id } } tok$l_source_line : INTEGER; { source line number of token } tok$l_token_length : INTEGER; { length of token string } tok$t_token_string : STRING(1024); { token string } END; k$t_token_string : STRING(1024); { token string } D; {** MODULE externals **} 4-27 EXAMPLES EXAMPLES et Job/Process Information system service } FUN EFN : BYTE_DATA(4) VAR PIDADR : BYTE_DAT PRCNAM : STRING(<$n3>); ; VAR ITMLST : ANYTYPE; VAR IOSB : BYTE_DATA(8) VAR ASTADR : ^ANYTYPE; ASTPRM : BYTE_DATA(4) := TPRM : BYTE_DATA(4) := ZERO) : INTEGER; EXTERNAL; {** MODULE more_examples IDENT V1.0 **} TYP more_examples$$typ1 = PACKED ARRAY[1..2] more_examples$$byte = PACKED ARRAY[1..8] OF [BYTE] -128..1 re_examples$$byte = PACKED ARRAY[1..8] OF [BYTE] -128..127; { { CSR07 (+^o16) - Interrupt Summary 2 CSR } { Example of Union } { } } CON sgp$m_clipped = %x2; %x1; sgp$m_isum2_1 = %xFFFC p$m_isum2_1 = %xFFFC; TYP 1 : (isum2 : [WORD] 0..65535; { InterruptSumma ); m2 : [WORD] 0..65535; { InterruptSummary2CSR } 2 : (isu ); m2_bits : BYTE_DATA(2); 3 : (sgp sgp$v_clipped : [POS(1)] BOOLEAN; { Clipped } sgp$v_isum2_1 : [POS(2),BIT(14)] 0..16383; } ) $v_isum2_1 : [POS(2),BIT(14)] 0..16383; END; D; { { an example with one of every data type } { } } CON sdl$m_b2 = %x6; x1; sdl$m_b3 = %x38; l$m_b3 = %x38; TYP 1 : (sdl$r_integer_types : BYTE_DATA(31); { for fun, overlay signed and uns sdl$f_f : REAL; { single floating } unsigned } sdl$r_dg : BYTE_DATA(40); { good place for a union array } sdl$h_h : BYTE_DATA(16); { huge floating } sdl$p_dec : PACKED ARRAY[1..11] OF [BIT(4)] 0..15;; { packed decima sdl$r_some_bits : BYTE_DATA(1); F [BIT(4)] 0..15;; { packed decimal } sdl$r_some_bits : BYTE_DATA(1); 4-28 EXAMPLES EXAMPLES sdl$t_string : STRING(32); { character string } sdl$t_vstring : VARYING_STRING(128); { character varying } sdl$a_p1 : ^INTEGER; { pointer to longword } sdl$a_p2 : ^more_examples$$typ1; { pointer to char string array } sdl$a_p3 : ^isum2_word ; { pointer to aggregate } sdl$a_p4 : ^ANYTYPE; { untyped pointer } sdl$a_p5 : PACKED ARRAY[1..10] OF ^more_examples$$byte; { array of ); a_p5 : PACKED ARRAY[1..10] OF ^more_examples$$byte; { array of pointers to an array } 2 : (sdl sdl$d_d : [POS(280)] DOUBLE; { double floating } sdl$v_b1 : [POS(776)] BOOLEAN; { one bit } sdl$v_b2 : [POS(777),BIT(2)] 0..3; { two bits } sdl$v_b3 : [POS(779),BIT(3)] 0..7; { three bits } ); v_b3 : [POS(779),BIT(3)] 0..7; { three bits } 3 : (sdl sdl$w_two : [POS(8),WORD] -32768..32767; { word datatype; } sdl$l_three : [POS(24)] INTEGER; { a longword datatype } sdl$q_four : [POS(56)] LARGE_INTEGER; { a quadword datatype } sdl$o_five : [POS(120)] BYTE_DATA(16); { an octaword datatype } sdl$g_g : [POS(280)] DOUBLE; { grand floating } ); g_g : [POS(280)] DOUBLE; { grand floating } 4 : (sdl ); $r_unsigned_types : [POS(0)] BYTE_DATA(31); { unsigned data types } 5 : (sdl sdl$w_utwo : [POS(8),WORD] 0..65535; sdl$l_uthree : [POS(24)] BYTE_DATA(4); sdl$q_ufour : [POS(56)] BYTE_DATA(8); sdl$o_ufive : [POS(120)] BYTE_DATA(16); ) $o_ufive : [POS(120)] BYTE_DATA(16); END; D; { E xample of an implicit union with dimension } TYP 1 : (w_fid : PACKED ARRAY[1..3] OF [WORD] -3 ); id : PACKED ARRAY[1..3] OF [WORD] -32768..32767; 2 : (tst ); $r_fill_3 : BYTE_DATA(6); 3 : (tst tst$w_second : [POS(16),WORD] -32768..32767; tst$w_third : [POS(32),WORD] -32768..32767; ) $w_third : [POS(32),WORD] -32768..32767; END; END; 4-29 EXAMPLES EXAMPLES 4.1.10 Ada Output 4.1.10 Ada Output wit package SDLEXAM is TEM; kage SDLEXAM is -- module $defopr MAX_ARGUMENTS : constant := 255 BLOCK_LIST_ID :ADDRESS; := 255; -- assign values to conte -- assign values to context identifiers CTX_K_BYTES : constant := 1; -- 1 CTX_K_WORDS : constant := 2; -- 2 CTX_K_LONGS : constant := 3; -- 3 CTX_K_QUADS : constant := 4; -- 4 CTX_K_OCTAS : constant := 5; -- 5 CTX_K_OCTAS : constant := 5; -- 5 record OPR_OPBITS_TYPE is VARI SIZE_UNITS : UNSIGNED_3; OFFSET_UNITS : UNSIGNED_3; ALIAS : BOOLEAN; IGNED_3; end record; OOLEAN; d record; record PR_OPBITS_TYPE use VARI SIZE_UNITS at 0 range 1 .. 3; ; OFFSET_UNITS at 0 range 4 .. 6; ALIAS at 0 range 7 .. 7; .. 6; end record; 0 range 7 .. 7; for OPR_OP for OPR_OPBITS_TYPE'SIZE use 8; (VARIABLE_SIZE => FALSE, tant OPR_OPBITS_TYPE := SIZE_UNITS => 0, FALSE, OFFSET_UNITS => 0, ALIAS => FALSE); ALIAS => FALSE); record OPR_ARGBITS_TYPE is BY_D BY_IMMED : BOOLEAN; BY_REF : BOOLEAN; FILLER_1 : UNSIGNED end record; : UNSIGNED_5; d record; record PR_ARGBITS_TYPE use record 4-30 EXAMPLES EXAMPLES BY_IMMED at 0 range 1 .. 1; BY_REF at 0 range 2 .. 2; FILLER_1 at 0 range 3 .. 7; end record; at 0 range 3 .. 7; for OPR_AR for OPR_ARGBITS_TYPE'SIZE use 8; (BY_DESC => FALSE, : constant OPR_ARGBITS_TYPE := BY_IMMED => FALSE, BY_REF => FALSE, FILLER_1 => 0); FILLER_1 => 0); record OPR_OPERATOR_TYPE is ID COUNT : SHORT_INTEGER; SIZE : SHORT_INTEGER; LAST_USE : SHORT_INTEGE TYP : UNSIGNED_BYTE; R; NUMBER : UNSIGNED_BYTE; OPCODE : UNSIGNED_BYTE; OPBITS : OPR_OPBITS_TYPE; ARGBITS : OPR_ARGBITS_TYPE; OPERAND : SHORT_INTEGER_ARRAY end record; SHORT_INTEGER_ARRAY (0 .. 254); d record; record PR_OPERATOR_TYPE use ID COUNT at 2 range 0 .. 15; SIZE at 4 range 0 .. 15; LAST_USE at 6 range 0 .. 1 TYP at 8 range 0 .. 7; 15; NUMBER at 9 range 0 .. 7; OPCODE at 10 range 0 .. 7; OPBITS at 11 range 0 .. 7; ARGBITS at 12 range 0 .. 7; OPERAND at 13 range 0 .. 4079 end record; t 13 range 0 .. 4079; for OPR_OP for OPR_OPERATOR_TYPE'SIZE use 4184; (ID => 0, TYPE_INIT : constant OPR_OPERATOR_TYPE := COUNT => 0, SIZE => 0, LAST_USE => TYP => 0, 0, NUMBER => 0, OPCODE => 0, OPBITS => OPR_ ARGBITS => OPR_ARGBITS_TYPE_INIT, OPERAND => (others => 0)); INIT, OPERAND => (others => 0)); 4-31 EXAMPLES EXAMPLES TOK_K_SIZE : constant := 1036; TOK_K_SIZE : constant := 1036; -- token size record TOK_TOKEN_TYPE is -- filled in by LEX TOKE SOURCE_LINE : INTEGER; -- source TOKEN_LENGTH : INTEGER; -- length of token string ken TOKEN_STRING : STRING(1 .. 1024); -- token string end record; ING : STRING(1 .. 1024); -- token string d record; record OK_TOKEN_TYPE use TOKE SOURCE_LINE at 4 range 0 .. 31 TOKEN_LENGTH at 8 range 0 .. 31; TOKEN_STRING at 12 range 0 .. 8191 end record; ING at 12 range 0 .. 8191; for TOK_TO for TOK_TOKEN_TYPE'SIZE use 8288; (TOKEN_ID => 0, T : constant TOK_TOKEN_TYPE := SOURCE_LINE => 0, TOKEN_LENGTH => 0, TOKEN_STRING => (oth TOKEN_STRING => (others => ASCII.NUL)); -- -- Get Job/Process -- Get Job/Process Information system service STATUS : out CONDVALU_T EFN : in EFNUM_TYPE; YPE; -- return value PIDADR : in out PROCID_ PRCNAM : in PROCNAME_TYPE; ITMLST : in ITEMLIST_TYPE; IOSB : out IOSB_TYPE; YPE; ASTADR : in AST_HANDLE ASTPRM : in USERPARM_TYPE TPRM : in USERPARM_TYPE := USERPARM_ZERO); pragma INTERFACE (EXTERNAL, GETJPI); (CONDVALU_TYPE, EFNUM_TYPE, PROCID_TYPE, PROCNAME_TYPE, USERPARM_TYPE), EFNUM_TYPE, PROCID_TYPE, PROCNAME_TYPE, ITEMLIST_TYPE, IOSB_TYPE, AST_HANDLER, (VALUE, VALUE, R ALUE, VALUE, REFERENCE, DESCRIPTOR(S), REFERENCE, REFERENCE, VALUE, VALUE)); -- -- le more_examples IDENT V1.0 -- 4-32 EXAMPLES EXAMPLES -- Example of Union terrupt Summary 2 CSR -- xample of Union -- SGP_M_CLIPPED : constant := 16#00000002#; SGP_M_ISUM2_1 : constant := 16#0000FFFC#; SGP_M_ISUM2_1 : constant := 16#0000FFFC#; record ISUM2_TYPE is -- InterruptSummary2CSR FONT CLIPPED : BOOLEAN; -- Clipped or ISUM2_1 : UNSIGNED_14; Clipped end record; UNSIGNED_14; d record; record SUM2_TYPE use FONT CLIPPED at 0 range 1 .. 1; ISUM2_1 at 0 range 2 .. 15; end record; t 0 range 2 .. 15; for ISUM2_ for ISUM2_TYPE'SIZE use 16; (FONTERROR => FALSE, ant ISUM2_TYPE := CLIPPED => FALSE, , ISUM2_1 => 0); , ISUM2_1 => 0); -- a -- n example with one of every data type -- SDL_M_B2 : constant := 16#00000006#; SDL_M_B3 : constant := 16#00000038#; SDL_M_B3 : constant := 16#00000038#; record SDL_UNSIGNED_TYPES_TYPE is -- unsigned data types UONE UTWO : UNSIGNED_WORD; UTHREE : UNSIGNED_LONGW UFOUR : UNSIGNED_QUADWORD; UFIVE : UNSIGNED_LONGWORD_AR end record; NSIGNED_LONGWORD_ARRAY(0 .. 3); d record; record DL_UNSIGNED_TYPES_TYPE use UONE UTWO at 1 range 0 .. 15; UTHREE at 3 range 0 .. 31; UFOUR at 7 range 0 .. 63; UFIVE at 15 range 0 .. 127; end record; 15 range 0 .. 127; end record; 4-33 EXAMPLES EXAMPLES for SDL_UNSIGNED_TYPES_TYPE'SIZE use 248; (UONE => 0, YPES_TYPE_INIT : constant SDL_UNSIGNED_TYPES_TYPE := UTWO => 0, UTHREE => 0, UFOUR => (0, 0 UFIVE => (0, 0, 0, UFIVE => (0, 0, 0, 0)); record SDL_INTEGER_TYPES_TYPE is -- for fun, overlay signed and unsigned ONE TWO : SHORT_INTEGER; -- word datatype; ype; THREE : INTEGER; -- a longword datatype FOUR : UNSIGNED_QUADWORD; -- a quadword da FIVE : UNSIGNED_LONGWORD_ARRAY(0 .. 3); -- an octawo FIVE : UNSIGNED_LONGWORD_ARRAY(0 .. 3); -- an octaword datatype ----overlap other fields defined as comments since they ---- erlap other fields ----UN ----UNSIGNED_TYPES : SDL_UNSIGNED_TYPES_TYPE; -- unsigned data types en d record; record DL_INTEGER_TYPES_TYPE use ONE TWO at 1 range 0 .. 15; THREE at 3 range 0 .. 31; FOUR at 7 range 0 .. 63; FIVE at 15 range 0 .. 127; FIVE at 15 range 0 .. 127; ----comments since they overlap other fields defined as ---- mments since they overlap other fields ----UN ----UNSIGNED_TYPES at 0 range 0 .. 247; e for SDL_IN for SDL_INTEGER_TYPES_TYPE'SIZE use 248; (ONE => 0, YPES_TYPE_INIT : constant SDL_INTEGER_TYPES_TYPE := TWO => 0, THREE => 0, FOUR => (0, 0 FIVE => (0, 0, 0, FIVE => (0, 0, 0, 0)); record SDL_SOME_BITS_TYPE is B1 B2 : UNSIGNED_2; -- two bi B3 : UNSIGNED_3; -- three bits FILLER_1 : UNSIGNED_2; three bits FILLER_1 : UNSIGNED_2; 4-34 EXAMPLES EXAMPLES d record; record DL_SOME_BITS_TYPE use B1 B2 at 0 range 1 .. 2; B3 at 0 range 3 .. 5; FILLER_1 at 0 range 6 .. end record; at 0 range 6 .. 7; for SDL_SO for SDL_SOME_BITS_TYPE'SIZE use 8; (B1 => FALSE, E_INIT : constant SDL_SOME_BITS_TYPE := B2 => 0, SE, B3 => 0, FILLER_1 => FILLER_1 => 0); record SDL_ONE_OF_EACH_TYPE is -- show all data types INTE F : FLOAT; -- single floating PE; -- for fun, overlay signed and unsigned D : D_FLOAT; -- double floating D : D_FLOAT; -- double floating ----overlap other fields defined as comments since they ---- erlap other fields ----G ----G : G_FLOAT; -- grand floating --***NYI: (dec (one_of_each) ) Datatype: NYI_ DEC : NYI_PACKED_DECIMAL; -- packed decimal _DECIMAL SOME_BITS : SDL_SOME_BITS_TYPE; packed decimal TRUTH : BOOLEAN; -- boolean STRING : STRING(1 .. 32); -- c VSTRING_LENGTH : UNSIGNED_WORD; aracter string VSTRING : STRING(1 .. 128); -- P1 : ADDRESS; -- pointer to longword varying P2 : ADDRESS; -- pointer to char strin P3 : ADDRESS; -- pointer to aggregate array P4 : ADDRESS; -- untyped pointer ate P5 : ADDRESS_ARRAY (1 .. 10); -- arr end record; RESS_ARRAY (1 .. 10); -- array of pointers to an array d record; record DL_ONE_OF_EACH_TYPE use INTE F at 31 range 0 .. 31; 0 .. 247; D at 35 range 0 .. 63; D at 35 range 0 .. 63; ----comments since they overlap other fields defined as ---- mments since they overlap other fields ----G ----G at 35 range 0 .. 63; 4-35 EXAMPLES EXAMPLES DEC at 91 range 0 .. 47; SOME_BITS at 97 range 0 .. TRUTH at 98 range 0 .. 7; 7; STRING at 99 range 0 .. 255 VSTRING_LENGTH at 131 range 0 VSTRING at 133 range 0 .. 1023; 15; P1 at 261 range 0 .. 31; 023; P2 at 265 range 0 .. 31; P3 at 269 range 0 .. 31; P4 at 273 range 0 .. 31; P5 at 277 range 0 .. 319; end record; 7 range 0 .. 319; for SDL_ON for SDL_ONE_OF_EACH_TYPE'SIZE use 2536; ( ONE_OF_EACH_TYPE_INIT : constant SDL_ONE_OF_EACH_TYPE := INT F => 0.0, S => SDL_INTEGER_TYPES_TYPE_INIT, D => 0.0, H => 0.0, --***NYI: (dec DEC => NYI_PACKED_DECIMAL_ZERO, pe: NYI_PACKED_DECIMAL SOME_BITS => SDL_SOME_BITS_TYPE_IN TRUTH => FALSE, SOME_BITS_TYPE_INIT, STRING => (others VSTRING_LENGTH => 0, CII.NUL), VSTRING => (others => A P1 => ADDRESS_ZERO, ASCII.NUL), P2 => ADDRESS_ZERO, P3 => ADDRESS_ZERO, P4 => ADDRESS_ZERO, P5 => (others => ADDR P5 => (others => ADDRESS_ZERO)); -- Example of an implicit union with dimension record TST_FID_COMPONENT_TYPE is FIRS SECOND : SHORT_INTEGER; THIRD : SHORT_INTEGER; end record; HORT_INTEGER; d record; record ST_FID_COMPONENT_TYPE use FIRS SECOND at 2 range 0 .. 15; THIRD at 4 range 0 .. 15; end record; 4 range 0 .. 15; for TST_FI for TST_FID_COMPONENT_TYPE'SIZE use 48; TST_FID_COMPONENT_TYPE_INIT : constant TST_FID_COMPONENT_TYPE := 4-36 EXAMPLES EXAMPLES SECOND => 0, THIRD => 0); THIRD => 0); ARRAY (1 .. 3) of TST_FID RAY (1 .. 3) of TST_FID_COMPONENT_TYPE; ( others => TST_FID_COMPONENT_TYPE_INIT); E := others => TST_FID_COMPONENT_TYPE_INIT); end end SDLEXAM; 4-37 APPENDIX A APPENDIX A SUMMARY OF SDL KEYWORDS SUMMARY OF SDL KEYWORDS Keyword Use Keyword Use ADDRESS Data type keyword AGGREGATE Declaration of structure or union body ALIAS Option of ENTRY declaration ANY Parameter-passing data type keyword BASED Storage class keyword BITFIELD Data type keyword BOOLEAN Data type keyword BYTE Data type keyword CHARACTER Data type keyword COMMON Storage class keyword CONSTANT Named constant declaration keyword D_FLOATING Data type keyword DECIMAL Data type keyword DEFAULT Parameter description keyword DESCRIPTOR Parameter-passing keyword option DIMENSION Array declaration keyword for aggregates or items END Delimiter for the end of an aggregate body END_MODULE Delimiter for the end of a module A-1 SUMMARY OF SDL KEYWORDS SUMMARY OF SDL KEYWORDS ENTRY Declares an entry constant EQUALS Keyword in syntax of CONSTANT statement F_FLOATING Data type keyword G_FLOATING Data type keyword GLOBAL Storage class keyword H_FLOATING Data type keyword IDENT Identification option for MODULE keyword IN Parameter description keyword INCREMENT Option of CONSTANT declaration ITEM Declaration keyword LENGTH Keyword for CHARACTER and BITFIELD declarations LINKAGE Option of ENTRY declaration LONGWORD Data type keyword MASK Option for BITFIELD declaration MODULE Declaration keyword NAMED Parameter description keyword OCTAWORD Data type keyword OPTIONAL Parameter description keyword ORIGIN Keyword option for aggregate declarations OUT Parameter description keyword PARAMETER Option of ENTRY declaration PRECISION Keyword for DECIMAL declaration PREFIX Naming keyword option QUADWORD Data type keyword REF Parameter description keyword RETURNS Option of ENTRY declaration SIGNED Option for BITFIELD declaration A-2 SUMMARY OF SDL KEYWORDS SUMMARY OF SDL KEYWORDS STRUCTURE Aggregate or subaggregate declaration keyword TAG Naming option keyword keyword is currently on applicable for Ada output. keyword is currently on applicable for Ada output. UNION Aggregate or subaggregate declaration keyword UNSIGNED Integer data type declaration option VALUE Parameter-passing keyword option VARIABLE Option for ENTRY declarations VARYING Keyword option for CHARACTER declaration WORD Data type keyword A-3 APPENDIX B APPENDIX B SDL ERROR MESSAGES AND ERROR CONDITIONS SDL ERROR MESSAGES AND ERROR CONDITIONS that indicate errors in SDL syntax specify the line number in the SDL source file at which the error occurred. y the line number in the SDL source file at which the error occurred. ABORT, Fatal internal error; unable to continue execution Fatal Fatal An internal error has occurred. User Action: User Action: Please report the problem to Technical Languages. ADROBJBAS, Address object name must have based storage class Error based. address item is pointing to an aggregate that is not based. User Action: User Action: Change the storage class of the aggregate to based. DUPCONATT, Item name has duplicate or conflicting attributes Error Error A declaration contains keywords that are not compatible. User Action: the declaration, and invoke SDL again. DL declaration, correct the declaration, and invoke SDL again. ERREXIT, Error exit Fatal Fatal Previous errors prevent continuation. User Action: User Action: Correct the errors and invoke SDL again. INCDEFSTRUC, Incompletely defined structure B-1 SDL ERROR MESSAGES AND ERROR CONDITIONS SDL ERROR MESSAGES AND ERROR CONDITIONS Error has been completely defined. n referenced before the structure has been completely defined. User Action: User Action: Remove the reference and invoke SDL again. INFILOPN, Unable to open input file file-spec Fatal Fatal SDL cannot locate or open the SDL source file. User Action: file correctly. ify that you specified the name of the input file correctly. INTOVF, Integer overflow in expression Error does not fit in a longword. pression resulted in a value that does not fit in a longword. User Action: User Action: Correct the expression. INVBITFLD, Bitfield is not an aggregate member Error scalar items. s must be members of aggregates. They cannot be scalar items. User Action: aggregate. : Incorporate the BITFIELD declaration in an aggregate. INVFLDSIZ, Item name has bit field or offset length greater than 32 Error cannot generate the proper bit mask. larger than 32 bits or cannot generate the proper bit mask. User Action: the BITFIELD declaration occurs within an aggregate and you specify the MASK option, verify that the bit offset of the start of the declaration plus the bit field size does not exceed 32 bits. declaration plus the bit field size does not exceed 32 bits. INVOUT, Invalid attributes for output language language INVOUT, Invalid attributes for output language language Error target language. ruct or data type is invalid for the specified target language. User Action: SDL declaration correctly, or whether you may be requesting language output that you do not require. Either correct the declaration or reissue the SDL command so that the indicated language output routine does not execute. so that the indicated language output routine does not execute. B-2 SDL ERROR MESSAGES AND ERROR CONDITIONS SDL ERROR MESSAGES AND ERROR CONDITIONS INVPARMTYP, Invalid parameter type for language language INVPARMTYP, Invalid parameter type for language language Error language. ameter specification is illegal for the specified language. User Action: again. ion: Modify the parameter specification and invoke SDL again. parameter quired parameter encountered after an optional parameter Error Error Required parameters must not follow optional parameters. User Action: User Action: Correct the error and invoke SDL again. INVSHRIMG, Shareable image not found for specified language language INVSHRIMG, Shareable image not found for specified language language Error language. cannot find the image to support the specified language. User Action: appropriate area. SDL looks for the image in SYS$SHARE. Language support images are of the form, SDLlanguage.EXE, where language is an identifying character string for the language. For example, the FORTRAN back end is called SDLFORTRA.EXE, and the Macro back end is called SDLMACRO.EXE. SDLFORTRA.EXE, and the Macro back end is called SDLMACRO.EXE. LISFILOPN, Unable to open listing file file-spec Error Error SDL cannot open the indicated listing file. User Action: to which the SDL listing file is directed. ess to the directory to which the SDL listing file is directed. MATCHEND, End name does not match declaration name name MATCHEND, End name does not match declaration name name Warning does not match the most recent module name or aggregate name. er does not match the most recent module name or aggregate name. User Action: END or END_MODULE to see that all names match. Check whether you have illegally nested MODULE declarations. This is only a warning message, but may indicate an error. This is only a warning message, but may indicate an error. MULTDEFSYM, Multiply defined symbol Error Error A structure contains a duplicate symbol name. B-3 SDL ERROR MESSAGES AND ERROR CONDITIONS SDL ERROR MESSAGES AND ERROR CONDITIONS User Action: User Action: Remove the duplicate name and invoke SDL again. NOOUTPUT, No language output produced Warning prevented SDL from generating any output files. errors, which prevented SDL from generating any output files. User Action: messages. n: Correct the errors indicated by accompanying messages. NULLSTRUC, Null structure name has no members Error members. GGREGATE or subaggregate declaration did not have any members. User Action: declaration is correctly positioned in the file. subaggregate declaration is correctly positioned in the file. OUTFILOPN, Unable to open output file file-spec Error Error SDL cannot locate or open an SDL output file. User Action: file correctly. ify that you specified the name of the input file correctly. SYMTABOVR, Symbol table overflow Fatal Fatal SDL exceeded its symbol table space. User Action: file; if possible, split the file into several different files or modules. ossible, split the file into several different files or modules. SYNTAXERR, Syntax error Error is accompanied by a message indicating the type of error and tells you what type of token or keyword SDL expected but did not find. ou what type of token or keyword SDL expected but did not find. User Action: message and correct it. he syntax error from the accompanying message and correct it. UNDEFSYM, Undefined symbol name Error Error A name preceded by a number sign (#) is not defined. B-4 SDL ERROR MESSAGES AND ERROR CONDITIONS SDL ERROR MESSAGES AND ERROR CONDITIONS User Action: correctly and that it appears before its reference in the SDL source file. that it appears before its reference in the SDL source file. WARNEXIT, Warning exit Warning Warning A warning message has been issued. User Action: that results may not be as expected. but you should be aware that results may not be as expected. ZERODIV, Zero divide in expression Error divide-by-zero exception condition. DL declaration resulted in a divide-by-zero exception condition. User Action: User Action: Verify the expression and correct it. ZEROLEN, Item name has 0 or negative length Warning specified a length of 0 or less. claration or a DIMENSION option specified a length of 0 or less. User Action: value was specified using an SDL expression, verify the local symbol values and the results of arithmetic operations in the expression, if any. results of arithmetic operations in the expression, if any. B-5 APPENDIX C APPENDIX C GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES for other languages. A common "front end" reads the SDL declarations from a source file and creates a tree describing the declarations and their relationships. There is a separate shareable image "back end" for each language for which output is to be generated. After SDL builds the tree describing the data definitions, it invokes each shareable image requested by the language options specified on the SDL command line. requested by the language options specified on the SDL command line. This appendix describes how to add a language to SDL, including: o The requirements for coding a "back end" the new shareable image back end on of SDL that incorporates the new shareable image back end o The structure of the SDL tree and explanations of each field C.1 REQUIREMENTS FOR WRITING A NEW SDL BACK END C.1 REQUIREMENTS FOR WRITING A NEW SDL BACK END arguments. The first argument is the filename to be opened by the back end. The second argument is a structure called SDL$_SHR_DATA. All data that is shared between the front and back ends of SDL is passed in this structure. between the front and back ends of SDL is passed in this structure. advised. Arguments to any routine described in this document are passed by reference. The simplest way to write an output routine for another language is to use the PL/I output routine supplied in the distribution kit as a model or template. This source file, SDLPLI.PLI, is commented extensively to help you understand the requirements for writing an output routine. A copy of this program is included in Section C.4, "Sources." utine. A copy of this program is included in Section C.4, "Sources." C-1 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES common. All of the data that is shared between the SDL front end and back end is contained in this structure, and is passed as an argument. back end is contained in this structure, and is passed as an argument. C.1.1 The SDL$PUTLINE Routine C.1.1 The SDL$PUTLINE Routine has the calling sequence: t to the current output source file. It has the calling sequence: CALL SDL$PUTLINE (outfile,string,length) outfile The output file variable. string The buffer can have a maximum length of 1024 characters, and is assumed to be a character-varying string. 024 characters, and is assumed to be a character-varying string. length in the input buffer into lines of the given length as it outputs them. input buffer into lines of the given length as it outputs them. C.1.2 Writing a Source File Header C.1.2 Writing a Source File Header the source file, identifying the source file as an SDL-generated file and giving the date and time that the file was created. enerated file and giving the date and time that the file was created. SDL$HEADER as follows: e, the back end can invoke the function SDL$HEADER as follows: (SDL$_SHR_DATA,be (SDL$_SHR_DATA,begin-comment-char,end-comment-char) SDL$_SHR_DATA A shared data structure. begin-comment-char character(s) that begins a comment. This string may be null. ic character(s) that begins a comment. This string may be null. C-2 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES end-comment-char character(s) that ends a comment. This string may be null. ific character(s) that ends a comment. This string may be null. surrounded by the appropriate comment characters. uage output file, surrounded by the appropriate comment characters. C.1.3 Error Message Output C.1.3 Error Message Output errors, name mismatches, and so on. Any language back end may also write messages using the routine ERRMSG. ERRMSG has the calling sequence: ges using the routine ERRMSG. ERRMSG has the calling sequence: CALL ERRMSG (SDL$_SHR_DATA,msg-id,source-line,language); SDL$_SHR_DATA A shared data structure. msg-id present, only the following id is assigned: essage number. At present, only the following id is assigned: SDL$_INVOUT Invalid attributes for output language source-line error. You can specify the field NOD$L_SRCLINE from the current tree node for this parameter. eld NOD$L_SRCLINE from the current tree node for this parameter. language The language keyword for your language back end. the target source file to indicate potential language-specific problems. t source file to indicate potential language-specific problems. C.2 BUILDING A NEW SDL BACK END C.2 BUILDING A NEW SDL BACK END using SDL V2.0 or a later version. following procedure, you must be using SDL V2.0 or a later version. C-3 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES 1. Copy the following files from the current SDL kit area. *.IN - include files fo LNKBCKEND.OPT - linker options file I sources SUPPLANG.COM - linker command proced SDLTRNVEC.OBJ - required transfer vector SDLTRNVEC.OBJ - required transfer vector 2. Create an object library using the following command: $ LIBRARY/CREATE SDLBCKLIB SDLBCKOBJ.OBS $ LIBRARY/CREATE SDLBCKLIB SDLBCKOBJ.OBS have placed the above files. BRARY to be the area that you have placed the above files. 4. Compile your back end source file. wish sdl to activate. If the backend is SDLMYBCK.EXE, then define a logical name such as backend is SDLMYBCK.EXE, then define a logical name such as $ DEFINE SDLMYBCK disk$:[directory]SDLMYBCK.EXE $ DEFINE SDLMYBCK disk$:[directory]SDLMYBCK.EXE where disk$:[directory] is the location of your back end. 6. Link your back end with the following command $ @SUPPLANG SDLMYBCK $ @SUPPLANG SDLMYBCK The name of your SDL back end must begin with the string 'SDL', and must not exceed nine characters in length (not including the file extension). characters in length (not including the file extension). To use your new SDL back end, invoke it with the following command: $ SDL/LANGUAGE=MYBCK $ SDL/LANGUAGE=MYBCK the image in SYS$SHARE by default. If a logical name, SDLMYBCK, exists, SDL will attempt to activate the image pointed to by that logical name. l attempt to activate the image pointed to by that logical name. C.3 THE SDL TREE C.3 THE SDL TREE nodes. The fields defined in the general tree node are shown in Figure 1. Figure 1 is followed by: e general tree node are shown in Figure 1. Figure 1 is followed by: C-4 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES o Descriptions of the fields in a general tree node o Descriptions of the field contents for each type of node o Descriptions of field contents for specific data types The routine SDL$DUMP provides a tree dump for debugging purposes. To use SDL$DUMP, specify the /DUMP[=filename] switch when invoking SDL. (If no file name is given, the tree will be written to SYS$OUTPUT.) This will cause SDL to output the tree prior to calling any back ends. This will cause SDL to output the tree prior to calling any back ends. C-5 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES | nod$a_flink | +-------------------------------+ | nod$a_blink | +-------------------------------+ | b_byte |b_type |nod$w_size | +-------------------------------+ | nod$a_parent | +-------------------------------+ | nod$a_child | +-------------------------------+ | nod$l_srcline | +-------------------------------+ | nod$l_hidim | +-------------------------------+ | nod$l_lodim | +-------------------------------+ | nod$l_initial | +-------------------------------+ |nod$t_name (34 bytes char var) | +-------------------------------+ |nod$t_prefix(32 bytes char var)| +-------------------------------+ |nod$t_marker(32 bytes char var)| +-------------------------------+ |nod$t_tag (32 bytes char var) | +-------------------------------+ |nod$t_naked (34 bytes char var)| +-------------------------------+ | nod$l_offset | +-------------------------------+ | nod$l_fldsiz | +-------------------------------+ |unused bit(16) | nod$w_datatype| +-------------------------------+ | nod$l_flags | +-------------------------------+ | nod$l_typeinfo | +-------------------------------+ | nod$l_typeinfo2 | +-------------------------------+ | nod$a_comment | +-------------------------------+ | nod$t_typename | | (32 bytes char var) | +-------------------------------+ +-------------------------------+ Figure 1: Format of an SDL Tree Node Figure 1: Format of an SDL Tree Node C-6 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES C.3.1 General Format of Tree Nodes C.3.1 General Format of Tree Nodes fields are always filled in. Use of the other fields depends on the type of node. Unused fields are always zero filled. s depends on the type of node. Unused fields are always zero filled. NOD$A_FLINK Forward link pointer to the next node. NOD$A_BLINK Backward link pointer to the previous node. NOD$W_SIZE Node size in bytes. using the constants listed below (these constants are also defined in SDLNODEF.IN). ese constants are also defined in SDLNODEF.IN). Constant Meaning Constant Meaning NOD$K_COMMNODE Comment node the tree NOD$K_CONSTNODE Constant node NOD$K_ENTRYNODE External entry NOD$K_ITEMNODE Aggregate or scal item node ODE Aggregate or scalar NOD$K_MODUL NOD$K_PARMNODE Parameter nod NOD$K_OBJNODE Object type node NOD$K_HEADNODE Head of a list of NOD$K_HEADNODE Head of a list of nodes is described in detail in Section C.3.2, "Node Types and Definitions.") n Section C.3.2, "Node Types and Definitions.") containing module if it is a level 1 item; otherwise, it points to the parent aggregate of an aggregate member. If the node is a parameter node, this points to the entry node. If it is an object node, this points to the ADDRESS item. In all other cases, it points to the containing module. cases, it points to the containing module. a list of aggregate members. For an entry node, it points to the parameter list. For a module node, it points to a list of the level 1 nodes contained in the module. The node pointed to is the head node of the list; it has no other information except forward and backward link information except forward and backward link C-7 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES pointers to the list elements. which the declaration appears. source line on which the declaration appears. bound of the array's subscripts. s is the high bound of the array's subscripts. bound of the array's subscripts. s is the low bound of the array's subscripts. including prefix and tag, if any. identifier, including prefix and tag, if any. NOD$T_PREFIX A prefix with the item name. data type or usage of the item it names. e the data type or usage of the item it names. NOD$T_TYPENAME The name of the predefined VMS datatype. This field is available for back ends that make up their own symbols from the basic name, such as the size constant used in BLISS to describe the number of bytes in a field. ISS to describe the number of bytes in a field. level-1 aggregate. If the item is a bit field, then the NOD$L_OFFSET field corresponds to the nearest relative byte offset. responds to the nearest relative byte offset. total size, including any dimensioning. If the item is a bit field, this is the size in bits of the item. it field, this is the size in bits of the item. are expressed using the following constants: es are expressed using the following constants: Constant Data Type Constant Data Type TYP$K_BYTE Byte integer nter* TYP$K_BOOLEAN Boolean ger TYP$K_CHAR Character TYP$K_DECIMAL Packed decimal* TYP$K_DOUBLE Double floating TYP$K_FLOAT F-floating ing TYP$K_GRAND G-floating TYP$K_HUGE H-floating TYP$K_LONGWORD Longword int TYP$K_OCTAWORD Octaword integer TYP$K_OCTAWORD Octaword integer C-8 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES TYP$K_VIELD Bit field* eger TYP$K_WORD Word integer TYP$K_STRUCTURE Structure aggr TYP$K_UNION Union aggregate* e* TYP$K_ANY Any longword datat TYP$K_ENTRY An entry constant pe* TYP$K_ENTRY An entry constant that additional information is available about the data item, as described in Section C.3.3, "Data Type Information." d in Section C.3.3, "Data Type Information." NOD$W_FLAGS The following flags are defined: Flag Meaning Flag Meaning NOD$V_MASK Bitfield has a ma NOD$V_UNSIGNED Unsigned attribute wa NOD$V_COMMON Storage class is COMMON ecified NOD$V_GLOBAL Storage class is GLOBAL NOD$V_VARYING String is character varyi NOD$V_VARIABLE Variable option is specified ENTRY declaration specified for NOD$V_BASED Storage class is ba NOD$V_DESC Parameter is passed by d NOD$V_DIMEN Item is an array d by descriptor NOD$V_IN Item is an input p NOD$V_OUT Item is an output parameter NOD$V_BOTTOM Item is the last element in a NOD$V_BOUND A based aggregate is bound to a pointer by a BASED pointer-name option a pointer by NOD$V_REF Parameter is passed by refere NOD$V_USER_FILL Item is used as a filler erence NOD$V_ALIAS Item can be accessed by an internal name essed by an alternate NOD$V_DEFAULT Default attribu a parameter bute was specified for NOD$V_VARDIM '*' was speci NOD$V_OPTIONAL Optional attribute was specified for bute a parameter ibute was specified for NOD$F_SIGNED Signed attrib NOD$F_LINK Entry expands with special call NOD$F_LINK Entry expands with special call macro information. type-specific or node-specific information. NOD$L_TYPEINFO2 Contains data type-specific information. NOD$A_TYPEINFO2 Contains data type-specific information. NOD$A_COMMENT Points to a string of comment text associated C-9 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES with this node. C.3.2 Node Types and Definitions C.3.2 Node Types and Definitions type of node. tions describe valid fields in a tree node for each type of node. C.3.2.1 ROOT Nodes C.3.2.1 ROOT Nodes root node for the entire tree. The external pointer variable TREE_ROOT points to this node. ee. The external pointer variable TREE_ROOT points to this node. The forward and backward links point to a list of module nodes. No other fields are used. C.3.2.2 Comment Node C.3.2.2 Comment Node node are: ode indicates a comment. The fields used in this type of node are: NOD$A_COMMENT Points to a string of text NOD$A_PARENT Points to the module NOD$L_SRCLINE Gives the SDL source line number No other fields are used. C.3.2.3 Constant Nodes C.3.2.3 Constant Nodes constant node and the following fields are defined: the node is a constant node and the following fields are defined: NOD$L_TYPEINFO Gives the value of the constant. NOD$T_NAME Gives the name of the constant. NOD$T_PREFIX Gives the prefix of the name. NOD$T_TAG Gives the tag character part of the name. NOD$A_PARENT Points to the module. C-10 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES NOD$L_SRCLINE Gives the source line number in the SDL file. associated with this node. hat is a comment associated with this node. No other fields are used. The following flag is used: NOD$M_MASK Indicates constant is a bit mask. C.3.2.4 Entry Nodes C.3.2.4 Entry Nodes node. The following fields are defined: e node is an external entry node. The following fields are defined: If the entry has no parameters, this field contains 0. y has no parameters, this field contains 0. entry is a function; otherwise, it is 0. the entry is a function; otherwise, it is 0. NOD$L_TYPEINFO2 give data type-specific information, as described in Section C.3.3, "Data Type Information," if the entry is a function. Information," if the entry is a function. NOD$T_NAME Is the name of the entry. NOD$A_PARENT Points to the module. NOD$L_SRCLINE Gives the source line number. associated with this node. hat is a comment associated with this node. NOD$T_TYPENAME The name of the predefined VMS datatype. No other fields are used. The following flag is used: NOD$M_VARIABLE Indicates variable number of parameters. C.3.2.5 Item Nodes C.3.2.5 Item Nodes C-11 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES describing an aggregate member or a scalar item. The following fields are defined: aggregate member or a scalar item. The following fields are defined: to a list of its members. , this field points to a list of its members. structure member, or to the module if this node is a level-1 item. r to the module if this node is a level-1 item. NOD$L_HIDIM Gives the high bound, if this node is an array. NOD$L_LODIM Gives the low bound, if this node is an array. member. complete name of the aggregate or member. NOD$T_PREFIX Gives the prefix of the name. NOD$T_TAG Gives the tag character part of the name. prefix or tag. " name of the item, without the prefix or tag. NOD$W_DATATYPE Is the data type of the item. NOD$T_TYPENAME The name of the predefined VMS datatype. NOD$L_TYPEINFO2 give data type-specific information, as described in Section C.3.3, "Data Type Information." d in Section C.3.3, "Data Type Information." NOD$L_SRCLINE Is the SDL source line number. a level-1 aggregate. tes from the beginning of a level-1 aggregate. bytes for all data types except bit fields; the size of a bit field is given in bits. elds; the size of a bit field is given in bits. associated with this node. that is a comment associated with this node. No other fields are used. The following flags are used: NOD$M_BASED Indicates that the storage class is BASED. NOD$M_COMMON Indicates that the storage class is common. C-12 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES NOD$M_GLOBAL Indicates that the storage class is GLOBAL. NOD$M_DIMEN Indicates that the item is an array. "bottom" one in an aggregate. the last or "bottom" one in an aggregate. specified. hat an unsigned attribute was specified. specified. hat a signed attribute was specified. NOD$M_MASK Generates a mask definition for the bit field. C.3.2.6 Module Nodes C.3.2.6 Module Nodes The following fields are defined: ODE, the node is a module node. The following fields are defined: NOD$A_CHILD Points to a list of declarations in this module. NOD$T_NAME Is the name of the module. NOD$L_SRCLINE Is the SDL source line number. associated with this node. that is a comment associated with this node. NOD$T_NAKED Contains the ident string. No other fields are used. C.3.2.7 Parameter Nodes C.3.2.7 Parameter Nodes parameter. The following fields are defined: e describes an entry parameter. The following fields are defined: describes a parameter. for which this node describes a parameter. NOD$W_DATATYPE Is the data type of the parameter. NOD$L_TYPEINFO2 give data type-specific information, as described in Section C.3.3, "Data Type Information." in Section C.3.3, "Data Type Information." NOD$L_HIDIM Is the high bound, for a parameter that is an C-13 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES array. array. ow bound, for a parameter that is an array. attribute. al value given with a default attribute. is an aggregate. f members, if the parameter is an aggregate. NOD$T_NAME Is the parameter name. NOD$T_TYPENAME The name of the predefined VMS datatype. No other fields are used. The following flags are used: value. s that the parameter is passed by value. reference. at the parameter is passed by reference. descriptor. t the parameter is passed by descriptor. NOD$M_IN Indicates an input parameter. NOD$M_OUT Indicates an output parameter. specified for a parameter. t attribute was specified for a parameter. specified for a parameter. al attribute was specified for a parameter. dimension attribute. was specified in a dimension attribute. C.3.2.8 Object Nodes C.3.2.8 Object Nodes of object pointed to by an ADDRESS item. The following fields are defined: pointed to by an ADDRESS item. The following fields are defined: NOD$W_DATATYPE Is the data type of the item. C-14 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES NOD$L_TYPEINFO2 give data type-specific information, as described in Section C.3.3, "Data Type Information." in Section C.3.3, "Data Type Information." NOD$A_TYPEINFO2 points to an object node that is exactly the same as an entry node, except that no name field is supplied. node, except that no name field is supplied. TYP$K_UNION, then NOD$T_NAME contains the name of the previously defined aggregate that describes the type of aggregate pointed to. The field NOD$A_TYPEINFO2 gives the address of the previously defined aggregate node. ess of the previously defined aggregate node. NOD$L_HIDIM Gives the high bound, if the item is an array. NOD$L_LODIM Gives the low bound, if the item is an array. NOD$A_PARENT Points to the address item. No other fields are used. C.3.2.9 Head Nodes C.3.2.9 Head Nodes of a list of nodes. The forward and backward links point to the beginning and end of the list. No other fields are used. oint to the beginning and end of the list. No other fields are used. C.3.3 Data Type Information C.3.3 Data Type Information type information about aggregates, members, and items. The auxiliary fields NOD$L_TYPEINFO and NOD$L_TYPEINFO2 provide additional information for various data types, as described in this section. nal information for various data types, as described in this section. C.3.3.1 Integers C.3.3.1 Integers following flag may be used: , LONGWORD, QUADWORD, and OCTAWORD, the following flag may be used: NOD$M_UNSIGNED Indicates an unsigned integer. NOD$M_SIGNED Indicates a signed integer. C-15 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES C.3.3.2 Character Strings C.3.3.2 Character Strings defined: ATATYPE contains TYP$K_CHAR, then the following fields are defined: NOD$L_TYPEINFO Is the length of the character string. NOD$M_VARYING If set, indicates a character-varying string. C.3.3.3 Packed Decimal C.3.3.3 Packed Decimal defined: ATATYPE contains TYP$K_DECIMAL, the following fields are defined: NOD$L_TYPEINFO The precision of the item. NOD$L_TYPEINFO2 The scale of the item. C.3.3.4 Bit Fields C.3.3.4 Bit Fields defined: ATATYPE contains TYP$K_VIELD, the following fields are defined: NOD$L_TYPEINFO Contains the length of the field. relative to the byte offset contained in NOD$L_OFFSET. he byte offset contained in NOD$L_OFFSET. offset of the bit field. NOD$L_OFFSET is in the item node for this item or member. bit field. NOD$L_OFFSET is in the item node for this item or member. C.3.3.5 Boolean Data C.3.3.5 Boolean Data If NOD$W_DATATYPE contains TYP$K_BOOLEAN, no other fields are used. C.3.3.6 Address Data C.3.3.6 Address Data If NOD$W_DATATYPE contains TYP$K_ADDRESS, the following field is used: actually only one object node, but it is linked into a circular list like all other members of the tree. list like all other members of the tree. C-16 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES C.3.3.7 Structure Aggregates C.3.3.7 Structure Aggregates used: W_DATATYPE contains TYP$K_STRUCTURE, the following fields are used: NOD$A_CHILD Points to a list of member elements. NOD$L_TYPEINFO Gives the origin of the structure. to this aggregate, if any, by a BASED pointer-name option. if any, by a BASED pointer-name option. The following flag is used: BASED pointer-name option. to a pointer by a BASED pointer-name option. C.3.3.8 Union Aggregates C.3.3.8 Union Aggregates defined: ATATYPE contains TYP$K_UNION, the following fields are defined: NOD$A_CHILD Points to a list of member elements. NOD$L_TYPEINFO Gives the origin of the union. to this aggregate, if any, by a BASED pointer-name option. if any, by a BASED pointer-name option. The following flag is used: BASED pointer-name option. to a pointer by a BASED pointer-name option. C.3.3.9 Parameter Passing Attributes C.3.3.9 Parameter Passing Attributes to indicate that a parameter can have any data type, and the following bits may be set in NOD$W_FLAGS: have any data type, and the following bits may be set in NOD$W_FLAGS: immediate value. he parameter is passed by immediate value. descriptor. at the parameter is passed by descriptor. NOD$M_REF Indicates that the parameter is passed by C-17 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES reference. C.4 SOURCES C.4 SOURCES This section contains: o A copy of the build file that generates a new SDL o A copy of the PL/I back end C-18 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES C.4.1 The PL/I Output Routine C.4.1 The PL/I Output Routine The contents of the PL/I output routine, SDLPLI.PLI are shown below. $PLI: proc; %in %include 'sdltypdef.in'; /* data type definitions */ */ %include 'sdltypdef.in'; /* data type definitions */ %replace line_length by 132; /* output file line length */ /* DATA and EXTERNAL ROUTINE DECLARATIONS */ * Th * output file. The first argument is the address of a buffer * with the output text, and the second argument is the maximum * line length for the output file. Output lines are broken off * and output on the next line if they are too long broken off */ d output on the next line if they are too long dcl dcl SDL$PUTLINE entry (char(1024) var,fixed bin(31)); * T * the SDL utility and the current time and date he name of */ e SDL utility and the current time and date dcl l SDL$HEADER entry returns(char(1024) var); /* * T * the SDL tree external variable always points to the root of */ e SDL tree dcl dcl TREE_ROOT ptr static external; * T */ e following array gives the PL/I equivalents for SDL data types dcl l types(20) char (32) var; /* * T * assignments so that the numeric values of the symbols used for * indices do not have to be known lues of the symbols used for */ dices do not have to be known ty types(typ$k_byte)='fixed binary(7 types(typ$k_char)='character'; 7)'; types(typ$k_boolean)='bit(1) ali types(typ$k_decimal)='fixed decimal'; types(typ$k_double)='float binary(53)'; types(typ$k_float)='float binary(24)'; types(typ$k_grand)='float binary(53)'; types(typ$k_grand)='float binary(53)'; C-19 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES types(typ$k_longword)='fixed binary(31)' types(typ$k_octaword)='bit (128) aligned'; types(typ$k_quadword)='bit (64) aligned'; types(typ$k_vield)='bit'; (64) aligned'; types(typ$k_word)='fixed bi types(typ$k_structure)=''; ary(15)'; types(typ$k_union)='union'; types(typ$k_any)='any'; '; types(typ$k_any)='any'; * T */ ese equivalents are used for unsigned data types dcl dcl unsigned (20) char (32) var; unsigned(typ$k_word)='bit(16) aligned'; unsigned(typ$k_longword)='bit(32) aligned unsigned(typ$k_quadword)='bit(64) aligned'; unsigned(typ$k_octaword)='bit(128) aligned'; unsigned(typ$k_octaword)='bit(128) aligned'; /* LOCAL VARIABLES */ dcl buf char(10 dcl based_string char(102 dcl i fixed bin(31); 1024) var based; /* i fixed bin(31); * **** * ************************ OUTPUTNODE **************************** * Th * outputs the appropriate data declaration for each tree node. Each * node describes a data object eclaration for each tree node. Each */ de describes a data object */ OUTPUTNODE: proc (p,startp,level); * p * startp = address of where we started (i.e * stop in traversing a circular list ) . where to * level = level number of aggregate (increm * with each sub-aggregate egate (incremented by 1 */ with each sub-aggregate */ dcl level fixed bin(31) dcl tmpbuf char(32) var; cl tmpbuf char(32) var; /* * C * Case on the node type and go do the appropriate processing C-20 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES if goto case(p->nod$b_type); goto case(p->nod$b_type); CAS CASE (NOD$K_ROOTNODE): /* Root node */ * N * nodes of which this is the head on to list of module */ des of which this is the head */ goto comm goto common_2; CASE (NOD$K_COMMNODE): /* Comment node */ * I * declaration before outputting this comment output the previous */ claration before outputting this comment if l call sdl$putline(buf,line_le /* ll sdl$putline(buf,line_length); * C */ ear the buffer and let the common stuff output the comment line buf= goto comm to common; CASE (NOD$K_CONSTNODE): /* Constant node */ * D */ a straightforward %replace statement for the constant node buf= nod$l_typeinfo)||';'; t_name||' BY '||trim(p-> goto common; o)||';'; goto common; CAS CASE (NOD$K_ENTRYNODE): /* Entry node */ * D */ clare an external entry point buf= buf='DCL '||p->nod$t_name||' ENTRY '; * I */ it has parameters, then do down the parameter list if p buf=buf||'('; d^=null() then do; call outputnode call outputnode(p->nod$a_child->nod$a_flink, C-21 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES substr(buf,length(buf),1) appended by the parameter /* replace the comma routine with a closing r parentheses */ losing end; entheses */ /* d; * I */ it's a function, output the datatype if p buf=buf||' RETURNS ('; hen do; call puttype(p); ('; buf=buf||')'; ; end; f||')'; /* d; * C */ eck for options if p buf=buf||' OPTIONS(VARIABLE)'; e then buf=buf||';'; IONS(VARIABLE)'; goto common; goto common; CASE (NOD$K_ITEMNODE): /* Item node */ * I * declaration, then begin the DECLARE statement ng of an aggregate */ claration, then begin the DECLARE statement if l buf='DCL '; n do; if p->nod$w_d p->nod$w_datatype=typ$k_union then buf=buf||'1 '; ype=typ$k_union then end; uf||'1 '; else do /* e do; * I * declaration with a comma and output it , then begin a new * indenting and putting in the level number n begin a new line by */ denting and putting in the level number bu call sdl$putline buf=' '||copy(' ',level)||trim(lev end; '||copy(' ',level)||trim(level)||' '; /* d; * N */ matter what, now we put in the name and the data type buf= call puttype(p); name||' '; /* l puttype(p); * I */ there's an attached comment, append it to the output line if p if p->nod$a_comment^=null() then C-22 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES /* f=buf||'/*'||p->nod$a_comment->based_string||'*/'; * I * recursively call outputnode for its members aration, then */ cursively call outputnode for its members if p p->nod$w_datatype=typ$k_union then call outputnode(p->nod$a_child->nod$a_ p->nod$a_child,level+1); ild->nod$a_flink, /* ->nod$a_child,level+1); * I * the final semicolon and output the line (warn of non-zero origins) */ e final semicolon and output the line (warn of non-zero origins) if l buf=buf||';'; do; if (p->nod$w_da p->nod$w_datatype=typ$k_union) & p->nod$l_typeinfo^=0 then on) & buf=buf || ypeinfo^=0 then '/* WARNING: trim(p->nod$l_typeinfo) || ' */'; ' || call sdl$putline(buf,line_length); buf=''; putline(buf,line_length); end; ; goto co to common_3; CAS CASE (NOD$K_MODULNODE): /* Module node */ * P */ t out the module name as a comment call buf='/*** MODULE '||p->nod$t_name||' goto common; LE '||p->nod$t_name||' ***/'; to common; CASE (NOD$K_PARMNODE): /* Parameter node */ * I */ the parameter is an aggregate, then get the level number if l p->nod$b_type=typ$k_union then _structure | buf=buf||trim(level)||' '; then /* f=buf||trim(level)||' '; * P * list (extra last comma will be corrected by entry routine) r */ st (extra last comma will be corrected by entry routine) call buf=buf||','; ; goto common_2; to common_2; C-23 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES CASE (NOD$K_OBJNODE): /* Object node for pointer items */ * I * pointing to nodes-- PL/I doesn't care what a pointer is */ inting to buf= goto comm to common_2; CASE (NOD$K_HEADNODE): /* Header node */ * N * circular list h head nodes-- just use them to move down a */ rcular list buf= goto comm goto common_2; COMMON: * If * output it attached comment, then append it to end of line and */ tput it if p buf=buf||'/*'||p->nod$a_comment->b call sdl$putline(buf,line_length); sed_string||'*/'; buf=''; putline(buf,line_length); buf=''; /* ON_2: * T */ avel down the child node if p call outputnode(p->nod$a_child- p->nod$a_child,level+1); hild->nod$a_flink, p->nod$a_child,level+1); /* ON_3: * T */ avel across the circular list to the sibling node call end; utputnode(p->nod$a_flink,startp,level); return turn; /* *** * *************************** PUTTYPE **************************** * Th */ is routine formats the datatype information for an item */ C-24 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES /* YPE: proc(p); * P */ rameter: p = pointer to current node dcl l p ptr; /* * I */ there is a dimension, append it if ( buf=buf||'('||trim(p->nod$l_lodim)||':' (p->nod$l_hidim)||') '; $l_lodim)||':'||trim /* >nod$l_hidim)||') '; * Ch * datatype equivalences ttribute-- if present use different */ tatype equivalences if p buf=buf||unsigned(p->nod$w_datatype); else uf||unsigned(p->nod$w_datatype); /* * Ot */ herwise, just append from the datatype equivalenc array buf /* =buf||types(p->nod$w_datatype); * Ta */ ke care of special info for chars-- descriptor option and length if if p->nod$w_flags&nod$m_desc then buf=buf||'(*)'; gs&nod$m_desc then else |'(*)'; buf=buf| /* =buf||'('||trim(p->nod$l_typeinfo)||')'; * Ad */ d length for bit fields if p buf=buf||'('||trim(p->nod$l_typeinfo)||' /* =buf||'('||trim(p->nod$l_typeinfo)||')'; * Ad */ d precision and scale for packed decimal if p buf=buf||'('||trim(p->nod$l_typeinfo)||', trim(p->nod$l_typeinfo2)||')'; info)||','|| /* m(p->nod$l_typeinfo2)||')'; * Ap */ pend optional attributes of various kinds if p buf=buf||' VARYING '; m_varying then if p->nod$w_flags & nod$ buf=buf||' VALUE '; d$m_value then if p->nod$w_flags & no buf=buf||' STATIC EXTERNAL '; then if p->nod$w_flags & nod$m_global buf=buf||' GLOBALREF '; global then buf=buf||' GLOBALREF '; C-25 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES buf=buf||' BASED '; d$m_based then /* =buf||' BASED '; * Ch */ eck for descriptor-- only allowed with char if p if p->nod$w_datatype^=typ$k_char the buf=buf||' /* WARNING: Cannot output DESCRIPTOR for this datatype */'; put SCRIPTOR for this datatype */'; re return; PUTTYPE; end end OUTPUTNODE; /* *** * **************************** TRIM ****************************** * Ma */ kes a character string stripped of excess blanks from an integer TRIM: dcl i fixed bin; rns (char(32) var); dcl a char(32) var a=character(i); r; a=substr(a,verify return(a); erify(a,' ')); end TRIM; TRIM; /* * Ou */ tput the little SDL header with time and date info call call sdl$putline('/*'||sdl$header()| call sdl$putline(' ',line_length); |'*/',line_length); /* sdl$putline(' ',line_length); * Be */ gin at the root of the tree, and let it go call ll outputnode(tree_root->nod$a_flink,tree_root,0); re return; INDEX Ada output MACRO-32 representation, 3-34 request, 3-5 PASCAL representation, 3-39 translation summary, 3-51 PL/I representation, 3-37 translation summary, 3-51 PL/I representation, 3-37 C-26 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES ADDRESS declarations, 3-22 Based storage class, ADA representation, 3-51 ADA representation, 3-51 BLISS-32 representation, 3-28 BLISS-32 representation, 3 C representation, 3-30 C representation, 3-30 3-28 DATATRIEVE representation, 3-42 DATATRIEVE representatio default tag, 3-26 EPASCAL representation, 3-45 2 EPASCAL representation, 3-45 FORTRAN representation, 3-32 examples, 2-7 MACRO-32 representation, 3-34 FORTRAN representation, 3-32 PASCAL representation, 3-39 MACRO-32 representation, 3-34 PL/I representation, 3-37 PASCAL representation, 3-39 Binary notation, 3-6 3-37 PL/I representation, 3-37 Bit offset symbol, 2-3 AGGREGATE declarations, 3-11 Bit offsets, 2-13 2-3 aggregate body, 2-10 Bit strings, 2-5 examples, 2-10 to 2-11 BITFIELD declarati Aggregates ADA representation, 3-51 alignment within, 2-12 BLISS-32 representation, 3 in ADDRESS declarations, 3-23 C representation, 3-30 3-28 size of, 2-14 DATATRIEVE representatio ALIAS option, 3-20 default tag, 3-26 tation, 3-42 Alignment, 2-12 EPASCAL representat AND operator, 3-7 examples, 2-5 ntation, 3-45 ANY keyword, 2-16, 3-19 FORTRAN represe ADA representation, 3-51 MACRO-32 representation, 3-34 BLISS-32 representation, 3-28 offsets, examples, 2-13 3-34 C representation, 3-30 PASCAL representation, 3- DATATRIVE representation, 3-42 PL/I representation, 3-37 EPASCAL representation, 3-45 BLISS-32 output tion, 3-37 FORTRAN representation, 3-32 request, 3-5 MACRO-32 represenation, 3-34 translation su PASCAL representation, 3-39 BLISSF output, 3-28 , 3-28 PL/I representation, 3-37 BOOLEAN declarations, Arrays, 2-17, 3-24 ADA representation, 3-51 ASCII constants, 2-3 BLISS-32 representation, 3 ASCII value C representation, 3-30 3-28 operator, 3-6 DATATRIEVE representatio Asterisk (*) EPASCAL representation, 3-45 2 specify array dimensions, 3-20 example, 2-6 entation, 3-45 FORTRAN repres BASED pointer-name storage class, MACRO-32 representation, 3-34 3-23 PASCAL representation, 3-39 ADA representation, 3-51 PL/I representation, 3-37 BLISS-32 representation, 3-28 BYTE declarations, 2-5, 3-21 C representation, 3-30 ADA representation, 3-51 DATATRIEVE representation, 3-42 BLISS-32 representation, 3 EPASCAL representation, 3-45 C representation, 3-30 3-28 EPASCAL representation, 3-45 C representation, 3-30 Index-1 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES default tag, 3-26 DATATRIEVE representatio EPASCAL representation, 3-45 default tag, 3-26 tation, 3-42 FORTRAN representation, 3-32 EPASCAL representat MACRO-32 representation, 3-34 examples, 2-8 ntation, 3-45 PASCAL representation, 3-39 FORTRAN represe PL/I representation, 3-37 lists representation, 3-32 Byte offset symbol, 2-3 comme Byte offsets, 2-13 counter value, 2 examples, 2-9 2-10 C output MACRO-32 represen request, 3-5 PASCAL representation, 3-39 translation summary, 3-30 PL/I representation, 3-37 CHARACTER declarations, 3-22 within aggregates, 3-13 ADA representation, 3-51 Constant identifiers, 2-8 BLISS-32 representation, 3-28 in expressions, 2-3 -8 C representation, 3-30 Constant nodes, C-10 DATATRIEVE representation, 3-42 Constants des, C-10 default tag, 3-26 numeric, EPASCAL representation, 3-45 Correspondence tables examples, 2-6 COUNTER option, 2-10, 3-10 FORTRAN representation, 3-32 Current location symbols MACRO-32 representation, 3-34 in expressions, 2-3 s PASCAL representation, 3-39 in expressions, 2-3 PL/I representation, 3-37 Character strings, 2-6 3-21 declarations, 2-5, Characters valid in identifiers, ADA repr 3-6 BLISS-32 representation, 3 Comment node, C-10 C representation, 3-30 3-28 Comments DATATRIEVE representatio ADA representation, 3-51 default tag, 3-26 tation, 3-42 BLISS-32 representation, 3-28 EPASCAL representat C representation, 3-30 FORTRAN representation, 3-32 DATATRIEVE representation, 3-42 MACRO-32 representation, 3-34 EPASCAL representation, 3-45 PASCAL representation, 3-39 FORTRAN representation, 3-32 PL/I representation, 3-37 in CONSTANT declaration, 2-10 Data types, 2-4 tion, 3-37 local, 2-4, 3-8 declaration key MACRO-32 representation, 3-34 in ADDRESS declarations, 3-2 Output, 2-4, 3-7 of parameters, 3-19, 3-22 22 PASCAL representation, 3-39 returned by functions, 3-20 PL/I representation, 3-37 translation summary , 3-20 COMMON storage class, 2-16, 3-23 ADA, 3-51 ummary ADA representation, 3-51 BLISS-32, 3 BLISS-32 representation, 3-28 C, 3-30 3-28 C representation, 3-30 DATATRIEV DATATRIEVE representation, 3-42 EPASCAL, 3-45 2 EPASCAL representation, 3-45 FORTRAN, 3-32 FORTRAN representation, 3-32 MACRO-32, 3-34 MACRO-32 representation, 3-34 PASCAL, 3-39 PASCAL representation, 3-39 PL/I, 3-37 PL/I representation, 3-37 DATATRIEVE outpu CONSTANT declarations, 3-9 request, 3-5 t CONSTANT declarations, 3-9 request, 3-5 Index-2 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES BLISS-32 representation, 3-28 DECIMAL tion summary, 3-42 BLISS-32 representation, 3-28 DECIMAL Index-3 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES declarations, 3-21 EPASCAL representation, 3-45 2 ADA representation, 3-51 FORTRAN representation, 3-32 BLISS-32 representation, 3-28 MACRO-32 representation, 3-34 C representation, 3-30 PASCAL representation, 3-39 DATATRIEVE representation, PL/I representation, 3-37 3-42 DIMENSION keyword, 3-20 37 default tag, 3-26 Dimensions, 2-17, 3-24 EPASCAL representation, 3-45 Division operator, 3-7 FORTRAN representation, 3-32 DTR file type, 3-5 -7 MACRO-32 representation, 3-34 /DUMP qualifier, C-5 PASCAL representation, 3-39 /DUMP qualifier, C-5 PL/I representation, 3-37 DECIMAL constants, 2-3 ELN Pascal output e, 3-5 Decimal data, 2-5 request, 3-5 t DECIMAL declarations END keyword, 2-1 examples, 2-5 END_MODULE keyword, Declarations, 2-8, 3-8 ENTRY declarations, 3-18 syntax rules, 2-2 ADA representation, 3-51 translation summary BLISS-32 representation, 3 ADA, 3-51 C representation, 3-30 3-28 BLISS-32, 3-28 DATATRIEVE representatio C, 3-30 EPASCAL representation, 3-45 2 DATATRIEVE, 3-42 examples, 2-15 tation, 3-45 EPASCAL, 3-45 FORTRAN represen FORTRAN, 3-32 MACRO-32 representation, 3-34 MACRO-32, 3-34 PASCAL representation, 3-39 PASCAL, 3-39 PL/I representation, 3-37 PL/I, 3-37 ENTRY keyword tation, 3-37 DEFAULT keyword in ADDRESS de ADA representation, 3-51 Entry nodes, C-11 ations, 3-23 BLISS-32 representation, 3-28 EPASCAL output 1 C representation, 3-30 request, 3-5 DATATRIEVE representation, 3-42 translation su EPASCAL representation, 3-45 Error messages, B-1 , 3-45 FORTRAN representation, 3-32 output routines, C- MACRO-32 representation, 3-34 Examples, 4-1 es, C-3 PASCAL representation, 3-39 Ada output, 4 PL/I representation, 3-37 BLISS-32 output, 4 DEFAULT option, 3-20 C output, 4-8 , 4-5 Default storage class, 2-16 DATATRIEVE outp DESCRIPTOR keyword, 2-16, 3-19 EPASCAL output, 4-27 4 ADA representation, 3-51 FORTRAN output, 4-11 BLISS-32 representation, 3-28 MACRO-32 output, 4-14 C representation, 3-30 PASCAL output, 4-20 DATATRIEVE representation, 3-42 PL/I output, 4-17 EPASCAL representation, 3-45 SDL input, 4-1 7 FORTRAN representation, 3-32 Expressions 4-1 MACRO-32 representation, 3-34 operators, PASCAL representation, 3-39 parentheses, 3-7 PL/I representation, 3-37 rules, 3-6 3-7 DIMENSION declarations, 3-24 syntax, 2-3 ADA representation, 3-51 syntax, 2-3 ADA representation, 3-51 Index-4 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES C representation, 3-30 3-21 declarations, 2-5, C representation, 3-30 3-21 Index-5 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES BLISS-32 representation, 3-28 MACRO-32 representation, 3-34 C representation, 3-30 PASCAL representation, 3-39 DATATRIEVE representation, 3-42 PL/I representation, 3-37 default tag, 3-26 tation, 3-42 PL/I representation, 3-37 EPASCAL representat FORTRAN representation, 3-32 H_FLOATING declara MACRO-32 representation, 3-34 3-21 declarations, 2-5, PASCAL representation, 3-39 ADA repr PL/I representation, 3-37 BLISS-32 representation, 3 File types C representation, 3-30 3-28 for SDL output files, 3-5 DATATRIEVE representatio LIS, 3-4 default tag, 3-26 tation, 3-42 Files EPASCAL representat SDL input and output, 3-2 FORTRAN representation, 3-32 Fixed-point decimal data, 3-21 MACRO-32 representation, 3-34 precision, 3-21 PASCAL representation, 3-39 Floating-point data, 2-5 PL/I representation, 3-37 FOR file type, 3-5 Head nodes, C-15 ion, 3-37 FORTRAN output Hexadecimal notati request, 3-5 Hexadecimal notation, 3-6 translation su Function declarations, 2-15 Identifiers 2-8 in quotatio G_FLOATING declarations, 2-5, rules, 3-6 marks, 2-2 3-21 SDL--generat ADA representation, 3-51 using keywords, 2-3 3-24 BLISS-32 representation, 3-28 IN option, 3-19 2-3 C representation, 3-30 INCLUDE , 3-19 DATATRIEVE representation, 3-42 stateme default tag, 3-26 INCREMENT option, EPASCAL representation, 3-45 Integer data types, 2-5 FORTRAN representation, 3-32 ITEM declarations, 3-17 MACRO-32 representation, 3-34 data types, 2-4 3-17 PASCAL representation, 3-39 examples, 2-15 PL/I representation, 3-37 Item nodes, C-12 GLOBAL storage class, 2-16, 3-23 Item nodes, C-12 ADA representation, 3-51 BLISS-32 representation, 3-28 summary, A-1 C representation, 3-30 use as identif DATATRIEVE representation, 3-42 use as identifiers, 2-3 effect of /GLOBALDEF, 2-17, 3-23 Languages ualifier, 3-3 EPASCAL representation, 3-45 adding ou FORTRAN representation, 3-32 options, 3-5 routines, C-1 MACRO-32 representation, 3-34 supported, 1-1 PASCAL representation, 3-39 LENGTH keyword PL/I representation, 3-37 BITFIELD decla /GLOBALDEF qualifier example, 2-5 tions, 3-21 ADA representation, 3-51 CHARACTER declar BLISS-32 representation, 3-28 LINKAGE option, 3-21 ns, 3-22 C representation, 3-30 LIS file type, 3-4 DATATRIEVE representation, 3-42 /LIST qualifier, 3-4 DATATRIEVE representation, 3-42 /LIST qualifier, 3-4 Index-6 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES EPASCAL representation, 3-45 Local comments EPASCAL representation, 3-45 Local comments, 3-8 Index-7 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES 3-9 NAMED option, 3-20 examples, 2-8 Names, 3-6 , 3-20 Local symbol names, 2-8 local symb in expressions, 2-3 prefixes, 3-24 -8 Logical AND operator, 3-7 Negative offsets, Logical OR operator, 3-7 /[NO]COMMENTS qualifier, Logical shift operator, 3-7 /[NO]COPYRIGHT qualifier, 3-3 LONGWORD declarations, 2-5, 3-21 /[NO]DUMP qualifier, 3-3 3-3 ADA representation, 3-51 /[NO]GLOBAL_DEFINITION qua BLISS-32 representation, 3-28 3-3 AL_DEFINITION qualifier, C representation, 3-30 /[NO]HEAD DATATRIEVE representation, 3-42 /[NO]MODULE qualifier, 3-4 default tag, 3-26 /[NO]PARSE qualifier, 3-4 EPASCAL representation, 3-45 /[NO]VMS_DEVELOPMENT qualif FORTRAN representation, 3-32 3-5 DEVELOPMENT qualifier, MACRO-32 representation, 3-34 Nodes PASCAL representation, 3-39 Comme PL/I representation, 3-37 Constant, C-10 Lowercase letters in identifiers, Entry, C-11 0 2-2 Head, C-15 Item, C-12 MACRO-32 output Module, C-13 request, 3-5 Object, C-14 translation summary, 3-34 Parameter, C-1 MAR file type, 3-5 Root, C-10 -13 MASK declaration Numeric consta ADA representation, 3-51 Numeric constants, 2-3, 3-6 C representation, 3-30 DATATRIEVE representation, 3-42 Octal notation, 3-6 EPASCAL representation, 3-45 OCTAWORD declarations FORTRAN representation, 3-32 ADA representation, 3-51 3-21 MACRO-32 representation, 3-34 BLISS-32 representation, 3 PASCAL representation, 3-39 C representation, 3-30 3-28 PL/I representation, 3-37 DATATRIEVE representatio MASK declarations, 2-5, 3-22 default tag, 3-26 tation, 3-42 BLISS-32 representation, 3-28 EPASCAL representat Member declarations, 3-14 FORTRAN representation, 3-32 data types, 2-4 MACRO-32 representation, 3-34 MODULE declarations, 3-8 PASCAL representation, 3-39 ADA representation, 3-51 PL/I representation, 3-37 BLISS-32 representation, 3-28 Offsets presentation, 3-37 C representation, 3-30 negativ DATATRIEVE representation, 3-42 Offsets in bit fie EPASCAL representation, 3-45 Offsets within aggregates, 2- examples, 2-8 Operators hin aggregates, 2-12 FORTRAN representation, 3-32 in expres IDENT option, 2-8 summary, 3-7 , 2-3, 3-7 MACRO-32 representation, 3-34 OPTIONAL option, PASCAL representation, 3-39 OR operator, 3-7 -20 PL/I representation, 3-37 ORIGIN option, 2-1 Module name, 2-8 OUT option, 3-20 4, 3-12 Module nodes, C-13 Output comments, 3 Module nodes, C-13 Output comments, 3-7 Index-8 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES Multiplication operator, 3-7 file specification Multiplication operator, 3-7 file specifications, 3-5 Index-9 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES Output languages PASCAL representation, 3-39 adding, C-1 PL/I representation, 3-37 Output routines REFERENCE keyword, 3-19 37 requirements, C-1 RETURNS keyword , 3-19 sample, C-19 ADA representat EPASCAL representation, 3- Parameter data types, 2-15 PASCAL representation, 3-39 Parameter nodes, C-13 RETURNS option, 3-20 n, 3-39 PARAMETER option, 2-15, 3-19, ADA representation, 3-22 BLISS-32 representation, 3 Parameters C representation, 3-30 3-28 descriptions, 3-19, 3-22 DATATRIEVE representatio optional, 3-20 EPASCAL representation, 3-45 2 pass by descriptor, 3-19 FORTRAN representation, 3-32 specify default values, 3-20 MACRO-32 representation, 3-34 TYPE, 3-20 PASCAL representation, 3-39 Parentheses in expressions, 3-7 PL/I representation, 3-37 PAS file type, 3-5 Root nodes, C-10 ion, 3-37 PASCAL output 3-5 Root nodes, C-10 request, 3-5 translation summary, 3-39 SDL command, 3-2 PL/I output examples, 3-5 request, 3-5 listing, 3-4 translation summary, 3-37 specify output PLI file type, 3-5 target languages, 3-3 -5 Pointers, declarations, 2-7 SDL translation s, 3-3 Precedence of operators, 3-7 to ADA, 3-51 PRECISION to BLISS-32, 3 keyword, 2-5 to C, 3-30 3-28 option, 3-21 to DATATRIEV PREFIX option, 2-18, 3-24 to EPASCAL, 3-45 2 Prefixes, 2-18, 3-24 to FORTRAN, 3-32 Procedure parameters, 2-15 to MACRO-32, 3-34 to PASCAL, 3-39 QUADWORD declarations, 2-5, 3-21 to PL/I, 3-37 ADA representation, 3-51 Shift operator, 3 BLISS-32 representation, 3-28 Signed integer data, C representation, 3-30 SIGNED keyword ata, 2-5 DATATRIEVE representation, 3-42 BITFIELD decla default tag, 3-26 Sources, SDL, C-18 ons, 3-22 EPASCAL representation, 3-45 Storage SDL, C-18 FORTRAN representation, 3-32 floatin MACRO-32 representation, 3-34 integer data, 2-5 , 2-5 PASCAL representation, 3-39 of structures and u PL/I representation, 3-37 Storage classes, 2-16, 3-23 -10 translation summary 3-23 R32 file type, 3-5 ADA, 3-51 ummary REF keyword BLISS-32, 3 ADA representation, 3-51 C, 3-30 3-28 BLISS-32 representation, 3-28 DATATRIEV C representation, 3-30 EPASCAL, 3-45 2 DATATRIEVE representation, 3-42 FORTRAN, 3-32 DATATRIEVE representation, 3-42 FORTRAN, 3-32 Index-10 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES FORTRAN representation, 3-32 PASCAL, 3-39 FORTRAN representation, 3-32 PASCAL, 3-39 Index-11 GENERATING SDL OUTPUT FOR OTHER LANGUAGES GENERATING SDL OUTPUT FOR OTHER LANGUAGES STRUCTURE declarations, 3-13 Unions epresentation, 3-37 ADA representation, 3-51 storag BLISS-32 representation, 3-28 Unsigned integers, 2-5 10 C representation, 3-30 UNSIGNED keyword, 2-5, 3 DATATRIEVE representation, 3-42 Uppercase letters in identifi default tag, 3-26 2-2 letters in identifiers, EPASCAL representation, 3-45 2-2 examples, 2-10, 2-12 FORTRAN representation, 3-32 ADA representation, 3-51 MACRO-32 representation, 3-34 BLISS-32 representation, 3 PASCAL representation, 3-39 C representation, 3-30 3-28 PL/I representation, 3-37 DATATRIEVE representatio storage allocation, 2-10 EPASCAL representation, 3-45 2 Subaggregate declarations, 2-12, FORTRAN representation, 3-32 3-13 MACRO-32 representation, 3-34 Subtraction operator, 3-7 PASCAL representation, 3-39 Symbols, local, 2-8, 3-9 PL/I representation, 3-37 VARIABLE option, 2-16, 3-20 TAG option, 2-18, 3-24 ADA representation, 3-51 Tags, 2-18, 3-25 BLISS-32 representation, 3 default tag letters, 3-26 C representation, 3-30 3-28 Translation summaries, 3-28, 3-30, DATATRIEVE representatio 3-32, 3-34, 3-37, 3-39, 3-42, EPASCAL representation, 3-45 2 3-45, 3-51 FORTRAN representation, 3-32 Translation tables, 3-27 to 3-28, MACRO-32 representation, 3-34 3-30, 3-32, 3-34, 3-37, 3-39, PASCAL representation, 3-39 3-42, 3-45, 3-51 PL/I representation, 3-37 Translator (SDL), invoke, 3-2 VARYING keyword, 2-6, 3-22 TYPE option, 3-20 to 3-21 /VMS_DEVELOPMENT qualifier effect, 3-36 qualifier UNARY minus operator, 3-7 effect, 3-36 UNION declarations, 3-13 ADA representation, 3-51 ADA representation, 3-51 BLISS-32 representation, 3-28 BLISS-32 representation, 3 C representation, 3-30 C representation, 3-30 3-28 DATATRIEVE representation, 3-42 DATATRIEVE representatio default tag, 3-26 default tag, 3-26 tation, 3-42 EPASCAL representation, 3-45 EPASCAL representat examples, 2-10 FORTRAN representation, 3-32 FORTRAN representation, 3-32 MACRO-32 representation, 3-34 MACRO-32 representation, 3-34 PASCAL representation, 3-39 PASCAL representation, 3-39 PL/I representation, 3-37 PASCAL representation, 3-39 PL/I representation, 3-37