Either fixed-length (numbered) or variable-length (numbered) records
can be passed to syntax checkers. Figure 1 shows
the format of the records that are passed.
TSO/E provides a standard interface that allows the EDIT modules
to invoke any syntax checker. Figure 2 shows
the EDIT modules that invoke syntax checkers, the standard interface,
and the syntax checkers that TSO/E provides. The interface consists
of a syntax checker parameter list that you use for writing your syntax
checker.
Figure 2. Interface Between
the EDIT Program and Syntax Checkers
The parameter list for the syntax checker points to the:
- Buffer control block
- Syntax checker communication area
- Option word
Table 1,
Table 2,
and
Table 3 show the contents of the buffer
control block, syntax checker communication area, and option word.
Table 1. Contents of the buffer control
blockDisp dec. |
Disp hex. |
Field name |
Field size |
Contents or meaning |
---|
0 |
0 |
C |
1 |
Number of records in buffer (maximum – 127). Bit zero is set
to 1 when the syntax checker has scanned all records in the buffer. |
1 |
1 |
Chain |
3 |
Address of next buffer; set to zero if this is the last buffer
in chain. |
4 |
4 |
Record |
Variable |
Line or lines of source input data to be syntax checked. Can
be fixed- or variable-length, numbered or unnumbered. |
Table 2. Contents of the syntax checker communication areaDisp desc. |
Disp hex. |
Field name |
Field size |
Setting |
Meaning (instruction to syntax checker) |
---|
|
|
|
|
Bits 0-3 |
(where n=0 or 1). |
|
|
|
|
0nnn |
First entry — obtain and initialize work area. If a buffer
chain is supplied, the syntax checker will set the relative line number
counter to zero. |
|
|
|
|
1n 1n |
Last entry — release the work area and return. Syntax checking
is not performed. |
|
|
|
|
1000 |
Normal entry — set relative line number to counter zero. Perform
syntax checking. |
0 |
0 |
None |
1 |
110n |
Entry after return code 8 (error - buffer checking incomplete)
— continue syntax checking. |
|
|
|
|
1001 |
Entry after return code 12 (complete statements have been checked,
but last statement in input buffer is incomplete). If there is no
more input (chain address of last buffer or buffer address is zero),
syntax check the incomplete statement and return. If there is a new
buffer chain, that is, more input, (chain address or buffer address
is not zero), resume syntax checking at the incomplete statement. |
|
|
|
|
Bits 4-7 |
Reserved |
1 |
1 |
None |
4 |
xxxx |
Address of work area stored by syntax checker on first entry. |
4 |
4 |
None |
4 |
xxxx |
Initial entry — maximum statement size specified when the EDIT
defaults for the data set type were set (if 0, checker assumes sufficient
storage for largest legal statement is available). Entry after return
code 4 (error detected, syntax checking complete, second-level message
present), or 8 (error detected, syntax checking incomplete) — address
of error message area. |
8 |
8 |
None |
4 |
xxxx |
Initial entry — temporary area. Subsequent entries — address
of second error message, if any. |
12 |
C |
None |
4 |
xxxx |
Temporary storage area used for GETMAIN. |
Table 3. Contents of the option wordDisp desc. |
Disp hex. |
Field name |
Field size |
Setting |
Meaning |
Syntax checker |
---|
0 |
0 |
None |
1 |
X'00' |
FORTRAN H level |
FORTRAN |
|
|
|
|
X'03' |
GOFORT |
FORTRAN |
|
|
|
|
X'04' |
FORTRANG1 |
FORTRAN |
|
|
|
|
|
|
|
|
|
|
|
X'00' |
IPLI level |
IPLI |
|
|
|
|
X'01' |
BASIC level |
BASIC |
|
|
|
|
|
|
|
|
|
|
|
xxxx |
Value of left source margin |
PLIF |
1 |
1 |
None |
1 |
Bits 0-5 |
Reserved |
FORTRAN |
|
|
|
|
|
|
|
|
|
|
|
Bit 6 = 1 |
FORTRAN G1/H Code and Go definition to be loaded on initial
entry. |
FORTRAN |
|
|
|
|
|
|
|
|
|
|
|
= 0 |
FORTRAN G1/H Code and Go definition not to be loaded on initial
entry. |
FORTRAN |
|
|
|
|
|
|
|
|
|
|
|
Bit 0 = 1 |
Entry from INPUT, Insert, linenum, *, CHANGE |
IPLI or BASIC |
|
|
|
|
Bit 1 = 1 |
Entry from DELETE |
IPLI or BASIC |
|
|
|
|
Bit 2 = 1 |
Entry from MERGE or RENUM |
IPLI or BASIC |
|
|
|
|
Bit 3 = 1 |
Translation already complete |
IPLI or BASIC |
|
|
|
|
Bit 4 = 1 |
Entry from RUN |
IPLI or BASIC |
|
|
|
|
Bits 5-7 |
Reserved |
IPLI or BASIC |
|
|
|
|
xxxx |
Value of right source margin |
PLIF |
2 |
2 |
None |
1 |
xxxx |
Record length of fixed-length records; binary zero, if variable-length
records. |
All |
3 |
3 |
None |
1 |
Bit 0 = 0 |
CHAR 60 |
PLI or IPLI |
|
|
|
|
= 1 |
CHAR 48 |
PLI or IPLI |
|
|
|
|
Bit 1 = 0 |
Line-numbered data set. |
All |
|
|
|
|
= 1 |
Data set not line-numbered. |
All |
|
|
|
|
Bit 2 |
Reserved |
All |
|
|
|
|
Bit 3 = 0 |
Diagnose an incomplete statement. |
All |
|
|
|
|
= 1 |
Delayed scan – return with code of 12, if last statement in
input buffer is incomplete. Immediate scan – possible incomplete
statement in buffer. |
All |
|
|
|
|
Bit 4 = 0 |
Fixed-length records. |
All |
|
|
|
|
= 1 |
Variable-length records. |
All |
|
|
|
|
Bit 5 = 0 |
Standard form source input. |
All |
|
|
|
|
= 1 |
Free form source input. |
All |
|
|
|
|
Bit 6 = 0 |
|
|
|
|
|
|
= 1 |
|
|
|
|
|
|
Bit 7 = 0 |
SCAN or SCAN ON specified. |
All |
|
|
|
|
= 1 |
NOSCAN or SCAN OFF specified. |
All |
The syntax checkers that TSO/E provides determine the attributes
of the associated data set type by referring to information that EDIT
initialization sets in the option word. For your own data set types
and syntax checkers, EDIT initialization does not place attribute
information in the option word. You can write an exit routine for
your syntax checker that fills in the option word according to information
that the user provides when editing a data set. Writing an exit for syntax checkers describes how to write an exit routine.