XRefDoc.tioga
Russ Atkinson (RRA) December 27, 1991 5:19 pm PST
XREF
CEDAR 10.0
XRef
-- Cedar cross-referencing
Russ Atkinson
© Copyright 1986, 1988, 1991 Xerox Corporation. All rights reserved.
Abstract: XRef is a simple program to cross-reference either Cedar programs or simple text. It registers the XRef command, which takes a list of files and produces a cross-reference file with the extension "xref".
Created by: Russ Atkinson
Maintained by: Russ <Atkinson.pa>
Keywords: cross-reference, xref
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

XRef (pronouced "ex-ref")
XRef takes a list of files on the command line, and creates a new file containing the cross-reference listing. If the file given is a DF file (determined solely by the extension "df"), then the file itself is not cross-referenced, but the source files listed therein are cross-referenced.
The file produced has the extension "xref" and the prefix taken from the first file. So the command "XRef A B C" would produce a file named "A.xref".
Alternatively, one can specify the output file, as in:
XRef A ← B C
which will create file A from files B and C.
The XRef command takes several switches. Unless otherwise specified, switches are "sticky", in that when a switch is specified it applies to all subsequently named files until the switch is turned off (prefixed by ~):
d: include warnings (in the xref file) about items that are defined but not apparantly used.
f: print full file names when file names are listed to the cross-reference file.
h: use local highest versions of files. The file names listed in any DF files are looked up in the local directory in their highest versions. This can be used to take a cross-reference on the working versions of source files instead of the stored files.
s: shallow, don't follow DF files. This switch forces the cross-referencing of the DF file itself, not the files defined in the DF file.
t: text file, not Cedar tokens. This switch uses a very simple tokenizer instead of the Cedar scanner available through IO.GetCedarToken. This switch also disables any distinction between use and definition for tokens.
v: verbose. This switch causes the cross reference to be in Tioga format, and to include positions as well as file names.
As an example, here are the first few lines of the verbose cross-reference file for XRef.mesa:
XRef.xref
taken on November 18, 1986 9:38:48 am PST
# files: 1, # tokens: 1065, # unique tokens: 222
XRef.mesa
action: 6774 6878 7006
ActionType: 749 7065
AddRef: 2117 3428 5102
addReference: 4214 4782 4805
AddReserved: 6281 6312 12823
aList: 6702
AppendInt: 196 8693
arg: 1583 1652 1685 6498 7696 9027 9065 9561 9636 9663 9695 12263 12290 12317 12344 12354 12372 12405 12442
. . .
The word at the start of the line appears at the source positions listed after the word. If the source position is given in boldface, then the instance is a definition, which means nothing more than the word starting at that position was followed by a colon, and was not inside of square brackets (formal arguments are not treated as definitions).