XRF - FORTRAN Cross-Referencer ============================== Users' Guide ============ XRF is a FORTRAN cross-referencing task. It can be run in most of the common ways, viz:- XRF XRF Command-Line RUN $XRF XRF> Command-Line XRF> Command-Line the only major restriction being that it will not accept a commandfile as input. The Command-Line is of the form:- outfile=infile[/LI] Where 'outfile' is the file to put the cross-reference map in (default extension .XRF) and 'infile' is the input file (default extension .FTN). If /LI is specified the output file is prefixed by a listing of the file with line and statement numbers appended. Note that the statement numbers will be the same as those on a FORTRAN compilation listing only if FORTRAN IV-PLUS is used (FORTRAN IV treats some IF statements as double statements). Current known restrictions on XRF are:- 1) Maximum on 2048 input statements (excluding comments) 2) Maximum of 2000 symbol definitions/references 3) Statement labels above 32767 cannot be handled. The Cross-Reference map contains various symbols against each symbol defining in which way it is used in the given statement. The symbols (and their meanings) are:- AS ASSIGN CA ARGUMENT IN CALL STATEMENT CM COMMON VARIABLE DA DATA DF DEFINE FILE DI DIMENSION DO DO DT BYTE, COMPLEX, DOUBLE PRECISION, INTEGER, LOGICAL, REAL ED ENCODE, DECODE EN ENTRY EQ EQUIVALENCE, PAUSE, RETURN, STOP GO GO TO ID CLOSE, OPEN IF IF IN INCLUDE IO ACCEPT, PRINT, READ, TYPE, WRITE IU BAKSPACE, ENDFILE, FIND, REWIND PD BLOCKDATA, FUNCTION, PROGRAM, SUBROUTINE PM PARMETER PS COMMON BLOCK NAME XP SUBPROGRAM NAME = STORED INTO BY REPLACEMENT STATEMENT @ STATEMENT LABEL DEFINITION XRF may produce a number of error messages. The first appears on the requesting terminal, the others in the output file. The output file also contains a count of the errors detected (if any were). 1. !!!CMD ERROR!!! OUT=IN PLEASE! The command-line specified to XRF was not of the form shown above. 2. ****** Unrecognised Statement Type in Statement nnn ****** The statement referred to did not contain a recognisable keyword or symbol. 3. ****** Statement Syntax Error in Statement nnn ****** The statement referred to did not conform to the syntax expected for the given keyword. 4. ****** Unbalanced Quotation Marks in Statement nnn ****** The statement referred to appeared to open a Hollerith quoted string but did not close it. XRF - FORTRAN Cross-Referencer ============================== System Guide ============ XRF consists of 22 modules (12 FORTRAN and 10 MACRO-11) which are overlaid as follows:- XRF ! XRFDAT ! NXTCHR ! ERROR ! FRMCTL ! LINEIN ! ITSTCH ! ----------------------------------------------------- ! ! ! XRFINI XREF OUTPUT ! ! ! GETMCX ENTER GETSYM ! NXNCHR ! NXTSYM ! IISHFT ! SRCTBL ! MAKENT ! ADDREF ! IPACK ! LOFSET ! ISTMT I have not investigated the structure of the task in any great detail, but roughly speaking the modules perform the following functions:- ADDREF (MACRO) - Adds a reference to the Symbol Table ENTER (FORTRAN) - Enter symbol or statement label into Symbol Table ERROR (FORTRAN) - Output any syntax error messages FRMCTL (FORTRAN) - Count lines in output & throw new pages GETMCX (MACRO) - Get command line from MCR GETSYM (MACRO) - Get values for symbol from Symbol Table IISHFT (MACRO) - Shift Integer n bits left IPACK (MACRO) - Convert characters to RAD50 ISTMT (MACRO) - Identify statement type by keyword ITSTCH (MACRO) - Test type of character passed LINEIN (FORTRAN) - Read line from input file LOFSET (MACRO) - See if character appears in given string MAKENT (MACRO) - Make entry in Symbol Table NXNCHR (FORTRAN) - Get next non-space/tab char from input NXTCHR (FORTRAN) - Get next line, print it if required, and calculate the new line and statement numbers for it NXTSYM (FORTRAN) - Find next symbol in input line OUTPUT (FORTRAN) - output the symbol table SRCTBL (MACRO) - Search Symbol Table for given symbol XREF (FORTRAN) - Process each statement according to its type XRF (FORTRAN) - Main calling module XRFDAT (FORTRAN) - Initialize common data areas XRFINI (FORTRAN) - Get command line from user & open files XRF is built by the commandfile XRF.CMD. If just @XRF is typed, it will assemble/compile all the relevant modules and then taskbuild the task. Alternatively, if @XRF xxxxxx is typed it will just assemble/compile xxxxxx and taskbuild the task. XRF.CMD dynamically creates XRF.BLD and XRF.ODL if they do not exist. XRF is a non-privileged task, with 4 units (1 & 4 assigned to TI:), a taskname of ...XRF and an ACTFIL count of 2. It is currently built with the following overlay:- ; ; X R E F . O D L ; ; OVERLAY DESCRIPTOR FOR X-REF (FORTRAN) TASK ; .ROOT XRFROT-LIB-*(O1,O2,O3) XRFROT: .FCTR XRF-XRFDAT-NXTCHR-ERROR-FRMCTL-LINEIN-ITSTCH O1: .FCTR XRFINI-GETMCX-LIB O2: .FCTR XREF-ENTER-NXNCHR-NXTSYM-IISHFT-SRCTBL-MAKENT-O21 O21: .FCTR ADDREF-IPACK-LOFSET-ISTMT-LIB O3: .FCTR OUTPUT-GETSYM-LIB LIB: .FCTR LB:[1,1]FOROTS/LB .END