When the XREFFILE file cannot be used by the XREFANALYZER program, the following error message is printed:
########## XREF ERROR: <error number> ##########
Then, one of the following messages is printed and the XREFANALYZER program is terminated.
Error Number |
Error Message |
1 - 15 |
INVALID XREFFILE |
500 |
COMPILER TOO OLD FOR XREFANALYZER |
501 |
COMPILER TOO NEW FOR XREFANALYZER |
502 |
TOO MANY PROCEDURES IN PROGRAM |
503 |
INTERNAL COMPILER ERROR |
504 |
THE MAXIMUM NUMBER OF DECLARATIONS (45590) THAT XREFANALYZER CAN PROCESS HAS BEEN EXCEEDED. |
Example 1
This example shows an ALGOL program with its corresponding cross-reference listing.
00000100 $SET XREF 00000200 BEGIN 00000300 REAL B, C, MEAN; 00000400 INTEGER I; 00000500 ARRAY R[1:3]; 00000600 DEFINE ONEE= 1;, 00000700 TWOO= 2;, 00000800 THREEE= 3;; 00000900 00001000 PROCEDURE ONE; 00001100 BEGIN 00001200 MEAN:= 2; 00001300 FOR I:= 0 STEP 1 UNTIL 5 DO 00001400 MEAN:= MEAN * B; 00001500 C:= C * MEAN; 00001600 END ONE; 00001700 00001800 00001900 R[ONEE]:= 1; 00002000 R[TWOO]:= 2; 00002100 R[THREEE]:= R[ONEE] + R[TWOO]; 00002200 B:= 3; 00002300 C:= 25; 00002400 ONE; 00002500 B:= 5; 00002600 ONE; 00002700 END. B---REAL AT (2,2)---DECLARED AT 00000300 00001400 *00002200 *00002500 B.0000 - PROCEDURE AT (1,2) - DECLARED AT 0000200 ENDS AT 00002700 C---REAL AT (2,3)---DECLARED AT 00000300 *00001500 *00002300 I---INTEGER AT (2,5)---DECLARED AT 00000400 *00001300 MEAN---REAL AT (2,4)---DECLARED AT 00000300 *00001200 *00001400 00001500 ONE - PROCEDURE AT (2,7) - DECLARED AT 00001000 ENDS AT 00001600 00002400 00002600
ONEE---DEFINE---DECLARED AT 00000600 00001900 00002100 R---REAL ARRAY AT (2,6)---DECLARED AT 00000500 *00001900 *00002000 *00002100 THREEE---DEFINE---DECLARED AT 00000800 00002100 TWOO---DEFINE---DECLARED AT 00000700 00002000 00002100
Each reference consists of an 8-digit sequence number, preceded by either an E if the reference appears in an address equation or an asterisk (*) if the value might be changed by the statement.
The sequence number is followed by a number sign (#) if the reference occurs as part of an expanded define.
Example 2
This example shows a FORTRAN program with its corresponding cross-reference listing.
00000100 $SET XREF 00000200 REAL B, C, MEAN 00000300 INTEGER I 00000400 DIMENSION R(3) 00000500 R(1) = 1 00000600 R(2) = 2 00000700 R(3) = R(1) + R(2) 00000800 B = 3 00000900 C = 25 00001000 CALL ONE 00001100 B = 5 00001200 CALL ONE 00001300 END 00001400 SUBROUTINE ONE 00001500 MEAN = 2 00001600 DO 10 I=0,5,1 00001700 MEAN = MEAN * B 00001800 C = C * MEAN 00001900 10 CONTINUE 00002000 RETURN 00002100 END
B ---REAL---DECLARED AT 00000200 *00000800 *00001100 B ---REAL---DECLARED AT 00001700 C ---REAL---DECLARED AT 00000200 *00000900 C ---REAL---DECLARED AT 00001800 *00001800 I ---INTEGER---DECLARED AT 00000300 I ---INTEGER---DECLARED AT 00001600 *00001600 MEAN ---REAL---DECLARED AT 00000200 MEAN ---INTEGER---DECLARED AT 00001500 *00001500 *00001700 00001800 ONE ---SUBROUTINE---DECLARED AT 00001000 00001200 00001400 R ---REAL ARRAY---DECLARED AT 00000400 *00000500 *00000600 *00000700 10 ---LABEL---FORWARD AT 00001600 OCCURS AT 00001900
Each reference consists of an 8-digit sequence number, preceded by an asterisk (*) if the value might be changed by the statement.
Example 3
This example shows a job that runs XREFANALYXER explicitly to generate the files that are necessary for Editor and INTERACTIVEXREF to perform cross-referencing commands.
1000 ?BEGIN JOB WBM; 2000 INTEGER TASKVAL; 3000 TASK T; 4000 TASKVAL:= -1; 5000 COMPILE OBJ/WBM/1 ALGOL [T] LIBRARY; 6000 C DATA 7000 $SET NOXREFLIST XREF
8000 BEGIN 9000 INTEGER I; 10000 I:= 0; 12000 END. 13000 ?%END OF ALGOL DATA 14000 IF T IS COMPILEDOK THEN 15000 BEGIN 16000 RUN SYSTEM/XREFANALYZER (0); 17000 VALUE=TASKVAL; 18000 FILE XREFFILE (TITLE=XREF/OBJ/WBM/1); 19000 FILE REFERENCES (SECURITYTYPE=PUBLIC,SECURITYUSE=IO); 20000 FILE DECLARATIONS (SECURITYTYPE=PUBLIC,SECURITYUSE=IO); 21000 END; 22000 ?END JOB
The title of the ALGOL program is WBM/1. When compiled, it generates cross-reference information containing a list of all identifiers that appear in the program and saves it as the XREF file. Since NOXREFLIST is TRUE, XREFANALYZER is not initiated by the ALGOL compiler and consequently no cross-reference listing is printed. When XREFANALYZER is run explicitly, the TASKVALUE equal to –1 causes the DECS and REFS files to be created and saved. Since the LINEWIDTH parameter is equal to 0, no printed output is produced.
Example 4
The following ALGOL code excerpt can be used to invoke XREFANALYZER with an XREFFILE file equated to KIND=PORT:
BEGIN ... FILE XREFFILE(KIND=PORT, MYUSE=OUT, MAXRECSIZE=510, BLOCKSTRUCTURE=EXTERNAL, YOURNAME="XREFFILE."); INTEGER REF_COUNT, XSZ; ARRAY XSTUF[0:510]; TASK XT; % TASK FOR XREFANALYZER PROCEDURE Z(LSIZ); VALUE LSIZ; REAL LSIZ; EXTERNAL; ... REPLACE XREFFILE.MYNAME BY ...; % XREF/<file name> REF_COUNT := ...; % High approx of # references ... REPLACE XT.NAME BY ="*SYSTEM/XREFANALYZER."; REPLACE XT.FILECARDS BY MYSELF.FILECARDS; REPLACE P:XSTUF BY "FILE XREFFILE(KIND=PORT, DEPENDENTSPECS, MYNAME=XREFFILE, " "YOURNAME=", XREFFILE.MYNAME; REPLACE P:P-1 BY ")" 48"00"; REPLACE XT.FILECARDS BY POINTER(XSTUF); XT.TASKVALUE := NABS(REF_COUNT); XT.JOBSUMMARY := VALUE(CONDITIONAL); PROCESS Z (0) [XT]; ... OPEN(XREFFILE, WAIT); XSZ := XREFFILE.ACTUALMAXRECSIZE; ... WRITE(XREFFILE, SZ, XSTUF); % usually within a loop ... LOCK(XREFFILE); WHILE XT.STATUS > 0 DO WAITANDRESET((5), MYSELF.EXCEPTIONEVENT); END