• Keine Ergebnisse gefunden

Listing Generation .1 Options

Im Dokument HAL/S COMPILER SYSTEM SPECIFICATION (Seite 25-30)

All Type 1 and Type 2 options listed in the HAL/S-FC User’s manual except debug options and HAL/S-360 unique options are printed in alphabetical order. For Type 1 options, just the option is printed if the option is on. If the option is off, the option is prepended with a “NO”.

2.6.2 Primary Formatted Listing

The central printed output of the compiler is the primary source listing. This listing is designed to document the actions taken by the compiler during its generation of an executable form of the user's source program in an indented, annotated format.

Additional information, such as block summaries and symbol table listings, are also part of the primary source listing.

The formatting of the primary source listing leads to the documentation of the users program in two ways: 1) variable annotation, and 2) logical indenting.

When operating in the SDL, additional information is provided on the primary source listing. The Record Sequence Number and Record Revision Indicator fields (see Section 2.1) are printed on the primary source listing next to the statements to which they apply. The revision level is printed to the right of the statement immediately following the vertical bar. Another vertical bar separates the revision level from the current scope. Additional details of the specific operations performed during SDL operation may be found in the HAL/SDL ICD.

All lines are single-spaced except for the following: there is a blank line before a group of one or more E-lines, C-lines or D-lines and after a group of one or more S-lines.

For D INCLUDES, the first statement number associated with the include is printed.

If there is an IF-THEN or IF-THEN-ELSE statement followed by a simple DO, the DO appears on the same line as the IF-THEN or ELSE except when the combination of the statements is too long for a single line. The combined IF-THEN and DO statements (including the semicolon of the DO) will be broken into multiple lines following regular compiler rules. The statement number for the IF-THEN will be printed as the statement number for each line. If the THEN and the DO or the ELSE and the DO are separated by a C-line or a D-line, the DO will be placed on its own line with its own statement number.

Normally, the current scope is printed to the right of each line in the compilation listing.

The value in the scope field will be truncated if it exceeds the maximum line length.

The following list indicates instances where the current scope will be replaced by a different value:

a. The scope field for END statements contains the statement number of the corresponding DO statement.

b. The scope field for the first statement line (that is not a label) of a case in a DO CASE group contains the case number.

1. Variable annotation - Each user-defined data symbol, when printed on the primary source listing, receives "marks" appropriate to the type and organization of the symbol. This annotation is that which is defined by the HAL/S Language Specification.

2. Logical indenting - Each statement printed on the primary source listing is formatted and indented to show internal statement structure, and to show the statements' hierarchical and nesting relationships to other statements in the compilation. The indention increment is 2 spaces.

c. The scope field for an IF-THEN followed by a simple DO is replaced by “DO=ST#”, where ST# is the statement number of the DO. Usually, the scope is replaced with the statement number of the DO for each line of a multi-line statement. However, because of certain compiler limitations or other uses of the scope field, the “DO=ST#”

may not appear on all of the lines. Following are the known cases:

1. If the length of the statement exceeds a certain compiler-limited size, the statement number of the DO will not be printed for the first line(s) of the statement.

2. If a C-line or D-line is placed inside the IF-THEN statement, the “DO=ST#” will only be placed in the current scope for the lines following the last C-line or D-line.

3. If the multi-line IF-THEN-DO is the first statement of a case in a DO CASE group, the scope field of the first line will contain the case number.

Only one of a-c from above will be placed in the scope field for a given line, with the order of precedence as listed above.

Depending on the contents of the macro, the formatting of statements containing replace macros may vary from the requirements listed above.

2.6.3 Error Messages

When compilation errors are detected by Phase 1, an error message is printed in the primary listing at the point of detection. All error messages have an identifying code associating with them.

The code is assigned to messages according to a general system which groups errors according to a class and a subclass. Multiple errors within a class/subclass

combination are assigned unique numbers within the group. Thus, every possible error in the HAL/S-FC compiler system has a unique identifying code.

The text of all error messages is maintained on a direct access dataset. The compiler retrieves error message text as needed from this dataset. During compilation, the ERROR DD card defines the error message dataset. This file has partitioned

organization and contains one member for each error message. The member names are identical to the identifying code assigned to the errors.

The record format of the error library is FB and the logical record length is 80 bytes.

The first record of each member defines the severity of that error. The severity is a single EBCDIC number in position one of the first record. The severities and their effects are:

Severity 0 messages will be warning messages (Severity 1) that have been downgraded. Processing will continue, and object code will be generated.

Severity 1 messages will be minor errors in which compilation will be allowed to continue. Since these errors could produce bad object code, compilation will abort and no object code will be generated.

Within the text of an error message, locations into which specific descriptive information may be placed are denoted by the appearance of two question marks (??). For errors which have this feature, the compiler supplies additional description text (such as the name of an identifier) to make the printed error message as specific and informative as possible.

2.6.4 Block Summaries

The HAL/S-FC compiler provides additional information on the primary listing at the close of HAL/S code blocks. The blocks for which summaries are given are

PROGRAM, TASK, FUNCTION, and UPDATE.

Information contained in block summaries consists of lists of labels or variable names used in various contexts within the block. The title "BLOCK SUMMARY" begins the list.

For all potentially summarized contexts within the block, a descriptive heading is printed followed by the list of names involved. A "*" next to any name in the block summary indicates that the name appears in a context which changes its value. The headings are listed below.

PROGRAMS AND TASKS SCHEDULED PROGRAMS AND TASKS TERMINATED PROGRAMS AND TASKS CANCELED EVENTS SIGNALED, SET, OR RESET EVENT VARIABLES USED

PROGRAM OR TASK EVENTS USED PRIORITIES UPDATED

Severity 2 messages will be major errors. These errors usually involve unimplemented features. Compilation will abort as results will be unpredictable. No object code will be generated.

Severity 3 messages will be severe errors that require user action.

Compilation will abort immediately and no object code will be generated.

Severity 4 messages will be internal compiler errors. Compilation will abort immediately and no object code will be generated. Compiler support personnel should be notified, and a compiler DR usually results.

2.6.5 Compilation Layout Summary

Immediately preceding the Symbol Table printout at the CLOSE of the HAL/S program, there is a compilation layout map, indicating the way in which PROGRAMS, TASKS, PROCEDURES, FUNCTIONS, and UPDATE blocks were defined. The indent level in this printout indicates the nesting level definition of the block shown. This serves to give a quick overview of the compilation structure.

2.6.6 Symbol & Cross Reference Table Listing

The symbol and cross reference table printed at the end of a HAL/S compilation listing provides a detailed accounting of all programmer-defined symbols. The table listing is organized into two parts: a structure template listing and an alphabetized total listing.

These parts are labeled appropriately and are separated by a page break.

Any structure templates defined in the compilation appear first in the symbol and cross reference table. The template names appear in alphabetical order. All structures declared using each template are listed alphabetically after “USED BY” under the template in the attributes and cross reference area. The body of each template (i.e. the levels defined under the template name) is also listed under the template name in the order of definition. This ordering provides a quick reference to the organization of the structure template.

Following any listing of the templates, an alphabetized listing of all programmer-defined symbols is printed. Symbols previously listed as element of a structure template are included in this list. However, the list is completely alphabetized and template

organization is not shown. When a particular symbol is independently defined in more than one name scope, the symbol is multiply listed in order of definition.

2.6.7 Built-in Function Cross Reference

Phase 1 also produces a listing of any HAL/S built-in functions used in a compilation.

The printout shows the statement numbers at which the references to the built-in functions occurred.

2.6.8 Replace Macro Text

If any HAL/S REPLACE statements were used in the compilation, the text of the macro is printed in the symbol table listing in the attributes and cross reference area.

2.6.9 Unformatted Source Listing

Under control of the "LISTING2" compiler option, Phase 1 will optionally produce, on the file defined by the LISTING2 DD card, a listing of the input (both SYSIN and

INCLUDE) source records as read by the compiler. No special annotation, formatting, or indenting is performed. In the case of input in the SDL compressed format, the LISTING2 option produces the records in their uncompressed format.

Im Dokument HAL/S COMPILER SYSTEM SPECIFICATION (Seite 25-30)