• Keine Ergebnisse gefunden

Conventions for Language Processors

Im Dokument PROGRAMMER GUIDE (Seite 189-197)

Conventions specifically for language processors are described in this subsection.

Standard Run Unit Invocation Format for Compilers

Shown following is the standard compiler invocation format of the

Honeywell-supplied compilers. All run unit invocation commands are invoked at the IBEX command level with a command of this format.

[{ON } [{TO }

] ]

!rununit [source[, update]][{OVER}[object][, listout]][(optionlist)]

[{INTO} ]

where

rununit is any valid disk fid. If no account name is specified, special.

fetch rules apply, as follows. If the file name is specified without a trailing period, the file is fetched from :SYS. If a trailing period does follow the file name, the file is fetched from the user's current file management account.

source is any valid fid. If this fid is omitted, the compiler will process source text entered from the CR device.

update is any valid fid. There is no default.

object is any valid fid. *6 file is the default.

listout is any valid fid. The LO device is the default.

optionlist contains rununit specific options, separated by commas.

Source, update, object, and listout are also frequently referred to

respectively as fid1, fid2, fid3, and fid4, and are collectively referred to as the positional fids.

This invocation performs the following functions for the invoked run unit:

1. The run unit's designated source DCB is assigned to the source fid if that fid is present on the command line; the flag BSJIT.PRFLA6S.SI is set by IBEX.

2. The run unit's designated update DCB is assigned to the update fid if that fid is present on the command line; the flag aSJIT.PRFLAGS.UI is set by IBEX.

CE62-00 Standard Run 14-1

Unit Invocation Format for Compilers

3. SimiLarLy, the run unit's designated object and Listout DCBs are assigned to the specific object and Listout fids (if present), subject to the impLications of the preposition preceding these fids, as follows:

ON causes IBEX to abort the command ~f either the object or Listout file currently exists.

OVER directs that the object and listout files are to over-write an existing file, if any. Specifically, the MSOPEN options FUN=CREATE, EXIST=NEWFILE are added to the assignments.

INTO directs that if the object or listout file exists, it is to be updated; otherwise, new files are to be created. This corresponds to the MSOPEN options FUN=CREATE, EXIST=OLDFILE.

The flags corresponding to these fields are BSJIT.PRFLAGS.OU and BSJIT.PRFLAGS.LS.

These actions occur prior to entry of the invoked run unit. There is more on this subject in the CP-6 Programmer Reference Manual on LINK, where the LINK options governing DCB associations are described, and in the CP-6 Monitor Services Reference Manual where DCBs and the services connected with them are described in detail.

Consider the example:

NEWCOMP A,B ON C,LP (SR(.ALPHA),XR)

Upon entry to NEWCOMP, the following assignments have been merged into NEWCOMP's DCBs:

MSSI = A (disk file); BSJIT.PRFLAGS.SI='1'B.

MSUI = B (disk file); BSJIT.PRFLAGS.UI='1'B.

MSOU = C (disk file; BSJIT.PRFLAGS.OU='1'B.

MSLO = LP (line printer); BSJIT.PRFLAGS.LS='1'B.

Note that the invocation, by its use of positional fids, implicitly specified the following options: UI, OU, LS. These options need not be specified . explicitly in the options field of the invocation assuming the the processor examines BSJIT.PRFLAGS. Note that the corresponding flags in the BSJIT are only modified by the invocation command; there is no link between the flags and any particular DCB name.

CE62-00 Standard Run 14-2

Unit Invocation Format for Compilers

DCB Usage Conventions

A processor designed to be invoked by its users via a standard invocation may have an interface which allows the user great flexibility in specifying the DCBs through which I/O to the positional fids takes place. If it is not desired to provide this flexibility, the processor's programmer may find it convenient to require the user to employ the standard DCB default associations taken by the LINKer, as described in the LINK section of the CP-6 Programmer Reference Manual.

When a CP-6 processor is source, update, obj ect, Invocation. To conform

Source DCB = MSSI

Update DCB = MSUI

Object DCB MSOU

Listout DCB MSLO

LINKed, specific DCBs may be associated with the and listout fields of the Command Processor

to the standard conventions, these DCBs should be:

The functions associated with these DCBs should also be common:

MSSI reading of source, base, or command input.

MSUI reading of update input, to be applied to the base input that is read through MSSI.

MSOU writing of the generated object unit resulting from the compilation;

MSOU should also be used for workspace files, e.g., in APL or BASIC.

MSLO writing of the generated print file resulting from the compilation.

Other common DCBs and related functions are:

MSSO writing of the merged update and source files to a new file.

MSDO writing of any error or warning messages; all standard processors will have an MSDO DCB.

MSME reading and writing of information which is to be dispatched to a mode-appropriate device. For instance, EDIT would like its output to appear on a terminal if the user is on-line and on the line printer if the user is in batch mode. This behavior is effected by assigning the special name 'ME' to the RES# field of the DCB.

CE62-QQ DCB Usage Conventions 14-3

Compiler Options Usages and Conventions

Options are included in compiler-invoking commands to affect the operation of the compiler. Presumably, writers of processors which provide options similar to those used by the Honeywell supplied compilers will want to use the same terms for these options, or at least will want to avoid using these terms in a manner inconsistent with their use by the Honeywell supplied compilers, and will want to follow similar practices concerning default options.

Accordingly, Table 14-1 provides definitions of the options considered

standard for new compilers. Note that in Table 14-1 the prefix N indicates NO (i.e., do not perform the option). The explicit use of the N prefix to an option supersedes any implicit assignment of the option.

Table 14-1. Descriptions of Standard Compiler Options Option Description

BC({ALLlnumber[, number] ••• })

Specifies the sequential number of each procedure in the source file to be included as a compile unit. ALL requests that aLL procedures be included.

[MIN]DM[AP][(option[, option] ••• )]

[MIN]PM[AP]

[MIN]SC[HEMA]

CE62-00

Requests that a data map listing of the compilation object unit be written to the device that is associated with the position 4 DCB. DefauLts, if no contrary action is taken, are: the position 4 DCB is MSLO, the associated device is the LO device. Options may consist of the foLlowing data types:

AU[TO], BA[SED], ST[ATIC], SY[MREF]. The prefix M requests a mini-map that consists of the first level of a structure only.

Requests that a procedure map indicating the relative Locations of external entry points, local subroutines, and labels be written to the device that is associated with the position 4 DCB. Defaults, if no contrary action is taken are:

the position 4 DCB is MSLO, the associated device is the LO device. The prefix M requests that the statement Locations be omitted from the map.

Specifies that debugging schema records are to be written to the file that is associated with the position 3 DCB.

Defaults, if no contrary action is taken, are: the position 3 DCB is MSOU, the file is that named in the third positional fid of the compiler invocation line. Default file name is *G.

The prefix M causes schema records to be written only for referenced, external, or SYMDEFed items.

Compiler Options Usages and Conventions 14-4

TabLe 14-1. Descriptions of Standard CompiLer Options (cont.>

Option [MIN]XR[EF]

[N]SYS

[N]LO

[N]LS

[N]LU

[N]OU

[N]SO

CE62-00

Description

Requests that a cross-reference Listing of the compiLed object units be written to the device that is associated with the position 4 DCB. DefauLts, if no contrary action is taken, are: the position 4 DCB is MSLO, the associated device is the LO device. This Listing contains a dictionary of symboL

definitions including alL occurrences of aLL references to the definition. The prefix M generates a cross reference for used references only.

Specifies that, if an INCLUDE statement or directive is encountered, the :LIBRARY account is to be searched if the fiLe is not found in any of the accounts in the SRCH List.

SYS is the default.

Specifies that the symbolic object listing is to be written to the device that is associated with the position 4 DCB.

Defaults, if no contrary action is taken, are: the position 4 DCB is MSLO, the associated device is the LO device.

Specifies that all source lines are to be written to the device that is associated with the position 4 DCB. Default~,

if no contrary action is taken, are: the position 4 DCB is MSLO, the associated device is the LO device. If LS is not specified, only source lines with errors are listed.

Specifies that the update file is to be listed. Defaults, if no contrary action is taken, are: the position 4 DCB is "SLO, the associated device is the LO device.

Specifies that an object unit is to be generated, and written to the fiLe that is associated with the position 3 DCB.

Defaults, if no contrary action is taken are: the position 3 DCB is MSOU, the file is that named in the third positional fid in the compiler invocation line. Default file name is

*G.

Requests that a new source file with updates ~erged is to be written through the MSSO DCB, to the file associated with that DCB.

Compiler Options Usages and Conventions 14-5

TabLe 14-1. Descriptions of Standard CompiLer Options (cont.) Option

[N]UI

[N]UR[EF]

[N]WA[RN]

SR[CH] (List)

Description

Specifies that update source code is to be read from the fiLe that is associated with the position 2 DCB. DefauLts, if no contrary action is taken, are: the position 2 DCB is MSUI, the fiLe is that named in the second positionaL fid in the compiLer invocation Line.

Requests that a List of unused data references be written to the device that is associated with the position 4 DCB.

DefauLts, if no contrary action is taken, are: the position 4 DCB is MSLO, the associated device is the LO device.

Requests that aLL warning messages generated by the compiLer be written through MSDO.

This option augments the specification of the accounts to be searched if a Language processor encounters an INCLUDE

statement or other directive which specifies a fiLe onLy by fiLe name. The List is a List of accounts, possibLy quaLified by packset, separated by commas. Each account designation in the List must have a Leading period. The accounts are

searched in the order specified by the List. If the fiLe i~

found in more than one pLace, the first instance found is the one that is incLuded. A maximum of eight accounts may be suppLied in the List. If the fiLe is not found in any of the accounts in the List, the :LIBRARY account and the user's running account wiLL then be searched, in that order. Note that a search of the :LIBRARY does not take place if the NSYS option ;s specified.

Specifying positionaL fids in the invocation of a standard compiLer will implicitly specify certain options, as foLlows:

• Specifying the second positional fid (the update fid) constitutes an implicit specification of the UI option.

• Specifying the third positional fid (the object fid) constitutes an implicit specification of the OU option.

• Specifying the fourth positional fid (the Listout fid) constitutes an implicit specification of the LS option.

If no option list is specified on the invocation line of a standard compiler, the compiler will take, in addition to the implicit options implied by use of positional fids, the following standard defauLts:

LS, OU, BC(ALL), MSCHEMA, NWARN, SYS

CE62-00 Compiler Options Usages and Conventions 14-6

If an option List is specified, a standard compiler will supply only three of these defaults, as follows:

• UnLess WARN was specified, NWARN will .be assumed.

• Unless NSYS was specified, SYS will be assumed.

• Unless BC(list) was specified, BC(ALL) will be assumed.

Suppose that a compiler called NEWCOMP, conforming to these conventions, is in place, and consider the following examples.

!NEWCOMP

Sets the options LS, OU, BC(ALL), MSCHEMA, SYS, and NWARN (the defaults assumed by the compiler). 'Source will be read through the MSSI DCB, the defauLt is the CR device.

!NEWCOMP A,B ON C,D

Sets the options UI, OU, LS, BC(ALL), MSCHEMA, SYS, and NWARN. Note that OU aLways impLies MSCHEMA unless the user specifies otherwise.

!NEWCOMP A,B ON C,D (NSCHEMA)

Sets the options UI, BC(ALL), SYS, and NWARN.

!NEWCOMP A,B (LS)

Sets the options UI, LS, BC(ALL), SYS, and NWARN.

Complier Error Handling

Compilers should behave consistentLy when dealing with errors in the specification of options; specifically, the compiler should give an

appropriate diagnostic and then error the step (issue an MSERR monitor call).

Errors covered by this general rule include specification of an illegal option, repeated options, and inconsistent options.

If the compiler uses a column-flag method of pointing to errors, i.e., placing a special character beneath the offending statement at the position where the error was detected, the following conventions should be observed:

1. The character used should be a caret or up-arrow IAI (octal 136 on the ASCII chart).

2. The offending statement and the flag should both be written through MSDO, unless the statement has already been written to the same print

destination as MSDO. This is to ensure that the error flag is not printed out of context.

CE62-00 Compiler Error Handling 14-7

Object Unit Conventions

The severity level assigned to an object unit by CP-6 compilers should conform to the following values (decimal):

a

no error or warning messages

4 warning messages issued during compilation

7 errors were detected which may be sufficient to cause execution failure 11 fatal error; the object unit contains flaws which will almost certainly

prevent proper execution

These values should be stored in the BSOUHEAD.SEVLEV field of the head record of the object unit.

Complier Output Control Via IBEX

The CP-6 system uses two IBEX-level commands to control generation of compiler output. These commands are:

!COMMENT or !DONT COMMENT

!LIST or !DONT LIST

These commands cause flags in the JIT to be set or reset (!DONT case); the corresponding flags are BSJIT.PRFLAGS.COMMENT and BSJIT.PRFLAGS.LIST. The meaning to compilers should be consistent with the following:

COMMENT flag = 'O'B; skip all writes through the MSDO DCB.

= '1 'B; perform all writes directed through MSDO DCB.

LIST flag = 'O'B; skip all MSLO writes

= '1 'B; perform all MSLO writes.

These flags should be checked for every write through the MSDO and MSLO DCBs, since the user may set them at any time. Note that the bits control only the specified DCB; the compiler may choose to skip an MSDO write, regardless of the COMMENT-bit value, when MSDO and MSLO are both assigned to the same thing (assuming the diagnostic is written through MSLO as well as MSDO).

The COMMENT and LIST flags are reset by IBEX when a job step terminates; thus the DONT-case resetting will only hold through the end of the next

program/processor invocation.

CE62-QQ Compiler Output Control Via IBEX 14-8

Im Dokument PROGRAMMER GUIDE (Seite 189-197)