Trailing-Edge
-
PDP-10 Archives
-
decuslib20-03
-
decus/20-0078/libsim/atrstr.sim
There are 4 other files named atrstr.sim in the archive. Click here to see a list.
00100 OPTIONS(/-Q/-D/-I/-W/-A/E/P:"ATTRIBUTE FILE STRUCTURE");
00200
00300 COMMENT
00400 -------
00500 Written by Lars Enderin, Swedish National Defence Research Institute,
00600 S-104 50 Stockholm 80, Sweden, June 1978.
00700 Copyright (C) 1978 by the Institute. Copying is allowed.
00800
00900
01000 ATRSTR translates the information contained in an ATR (attribute)
01100 file into a SIMULA data structure. The attribute file for a
01200 separately compiled SIMULA module (a SIMULA class, procedure or a
01300 dummy procedure heading for a MACRO-10 or FORTRAN coded procedure)
01400 contains that information which is necessary to determine the correct
01500 code to communicate with the separately compiled external module from
01600 a SIMULA program which uses it. The externally accessible information
01700 of an external module includes a) parameters of procedures and
01800 classes, b) the quantities declared at the outermost block level of a
01900 class, which may be ordinary variables, labels, procedures and local
02000 classes, and c) recursively, the quantities according to (b) for
02100 local classes. An external module also has an "entry name", which is
02200 normally identical to the SIMULA name of the class or procedure
02300 (initial 6 characters) and a "module name", which is derived from the
02400 name of the ATR file when created (if REL file is x.REL, ATR file is
02500 x.ATR). Each module also has an associated "unique identifier" which
02600 is changed when the ATR file information is changed on recompilation.
02700 This identifier and a set of (lexically) immediately following
02800 identifiers are used as global definitions of points within the code
02900 for the external module, e.g. the start of a prototype, start of
03000 declaration coding.
03100
03200 ATR module record layout:
03300
03400 An ATR module consists of 3 parts:
03500
03600 1) Entry and name blocks as in the REL file:
03700
03800 1a) ENTRY block (type 4):
03900
04000 XWD 4,1
04100 EXP 0 ;! relocation bits
04200 RADIX50 0,/<I-name>/
04300
04400 <I-name> is the SIMULA name of the class or procedure.
04500 This information, excluding the zero relocation word, is placed in
04600 the index block of a library file and is used when the module is
04700 looked up.
04800
04900
05000 1b) NAME block (type 6):
05100
05200 XWD 6,1
05300 EXP 0
05400 RADIX50 0,/<E-name>/
05500
05600 <E-name> is determined from the REL file name (<E-name>.REL) given in
05700 the command string to the compiler. Assuming default device,
05800 extensions, and path, the command string is
05900 <E-name>,<L-name>=<S-name> i.e. the file <S-name>.SIM is compiled to
06000 give the REL file <E-name>.REL, the ATR file <E-name>.ATR, the list
06100 file <L-name>.LST.
06200
06300 2) ATR information block:
06400
06500 This is disguised as a REL file comment block (type 0):
06600
06700 XWD 0,M
06800 <N words of ATR information>
06900
07000 The word count, M, is computed from the actual count N by regarding
07100 every 18th word as a relocation word which is not included in M.
07200 This is because LINK-10, LOADER, FUDGE2 and MAKLIB handle REL files
07300 in this fashion. A dummy zero word may sometimes have to be added to
07400 the end of the block to make the count come out correctly.
07500 The ATR information is:
07600
07700 2a) Heading:
07800
07900 One word, zero for a SIMULA procedure, the entry name in RADIX50 for
08000 MACRO-10 or FORTRAN procedures, and a unique identifier with a '%' as
08100 third character for a class.
08200
08300 2b) Attributes:
08400
08500 <A-list>::=ZQU[ZHB[<A-list>]...<zeroword>]
08600
08700 The attributes form an A-list. See Technical Documentation II.6 for
08800 the definition of ZQU and ZHB. Briefly, a ZQU record describes a
08900 declared quantity such as a variable, parameter, procedure or class.
09000 ZHB describes the internal structure of a class or the structure of a
09100 parameter list.
09200
09300 2c) Information for checking:
09400
09500 A list of ZHE(QQUACH) records (see II.6) is created, where each
09600 record corresponds to an external item referenced by this module.
09700 The list ends with a zero word.
09800
09900
10000 3) END block (type 5):
10100
10200 XWD 5,2
10300 EXP 0,0,0
10400
10500 This delimits the ATR module within a library file.
10600
10700 In the old record layout, only part 2 was present. The format was
10800 changed to allow creation of library files by FUDGE2 or MAKLIB, which
10900 treat only REL files. A SIMULA ATR file thus looks like a REL file
11000 with an ENTRY block, a NAME block, a COMMENT block and an END block.
11100
11200
11300
11400 RECORD LAYOUT for library ATR files:
11500
11600
11700 An ATR file with the layout described above may be made part of an
11800 ATR library file. FUDGE2 or MAKLIB can be used to create a library
11900 out of separate ATR files or other libraries. The format is that of
12000 an indexed REL file library:
12100
12200 1) The first block is an index block (type 14), with the structure:
12300
12400 XWD 14,177
12500 <index table>
12600 XWD -1,next
12700
12800 next is the number of the next index block in the file or -1 if no
12900 more index blocks exist.
13000
13100 <index table> consists of a series of <moduleitem>'s, where
13200 <moduleitem> is:
13300
13400 XWD 4,1
13500 RADIX50 0,/<I-name>/
13600 XWD W,B
13700
13800 W is the word offset within block B of the file where the submodule
13900 corresponding to <I-name> starts.
14000
14100
14200 The second block and following blocks (except for inserted index
14300 blocks) contain ATR file information copied into contiguous blocks of
14400 words. If the first block has a pointer to another index block, that
14500 index block is placed before the first submodule referred by an entry
14600 name in it. The second and following index blocks are similar. The
14700 chain of index blocks is finished by a block whose last non-zero word
14800 contains -1.
14900
15000
15100 The ATRSTR class contains classes to map the ATR file structure and
15200 procedures to set up the structure from an ATR file. The ATRLIB class
15300 contains an algorithm for scanning an ATR library file, finding each
15400 module name in turn and allowing for arbitrary use of the information
15500 found before continuing. "Wild card" lookup can be specified, i.e.
15600 parts of the module name can be arbitrary (specified by '?' or '*',
15700 where '*' is equivalent to at most 6 trailing '?' characters).
15800 ;