This chapter describes tools which build cross references, and which aid in analyzing LISP code
for building other cross reference - like tools.
17.1.1 RCREF - Cross Reference Generator for PSL Files
rcref is a Standard LISP program for processing a set of PSL function definitions to
- A ”Summary” showing:
- A list of files processed.
- A list of ”entry points” (functions which are not called or are called only by
- A list of undefined functions (functions called but not defined in this set of
- A list of variables that were used non-locally but not declared GLOBAL or
FLUID before their use.
- A list of variables that were declared GLOBAL but used as FLUIDs (i.e.
bound in a function).
- A list of FLUID variables that were not bound in a function so that one might
consider declaring them GLOBALs.
- A list of all GLOBAL variables present.
- A list of all FLUID variables present.
- A list of all functions present.
- A ”global variable usage” table, showing for each non-local variable:
- Functions in which it is used as a declared FLUID or GLOBAL.
- Functions in which it is used but not declared before.
- Functions in which it is bound.
- Functions in which it is changed by setq.
- A ”function usage” table showing for each function:
- Where it is defined.
- Functions which call this function.
- Functions called by it.
- Non-local variables used.
The output is alphabetized on the first seven characters of each function name.
RCREF also checks that functions are called with the correct number of arguments.
Algebraic procedures in Reduce are treated as if they were symbolic, so that algebraic constructs
actually appear as calls to symbolic functions, such as aeval.
RCREF adds the eval flag to some functions, so it probably cannot coexist with the compiler in a
SYSLisp procedures are not correctly analyzed.
RCREF should be used in PSL:RLisp. To make a file FILE.CRF which is a cross reference
listing for files FILE1.EX1 and FILE2.EX2 do the following in RLisp:
OUT ”file.crf”; ON CREF;
To process more files, more IN statements may be added, or the IN statement may be changed to
include more files.
*crefsummary If the switch CREFSUMMARY is ON then only the summary (see 1 above) is produced.
= [Initially:NIL] switch
Functions with the flag NOLIST are not examined or output. Initially, all PSL functions are so
flagged. (In fact, they are kept on a list NOLIST!*, so if you wish to see references to ALL
functions, then CREF should be first loaded with the command LOAD RCREF, and this variable
then set to NIL). (RCREF is now autoloading.)
nolist* (and cond list max min or plus prog prog2 progn times lambda abs add1 append apply assoc
atom car cdr caar cadr cdar cddr caaar caadr cadar caddr cdaar cdadr cddar cdddr caaaar caaadr
caadar caaddr cadaar cadadr caddar cadddr cdaaar cdaadr cdadar cdaddr cddaar cddadr cdddar
cddddr close codep compress cons constantp de deflist delete df difference digit divide dm eject
eq eqn equal error errorset eval evlis expand explode expt fix fixp flag flagp float
floatp fluid fluidp function densym get getd getv global globalp go greaterp idp intern
length lessp linelength liter lposn map map mapc mapcan mapcar mapcon maplist
max2 member memq minus minusp min2 mkvect nconc not null numberp onep open
pagelength pair pairp plus2 posn princ print prin1 prin2 prog2 put putd putv quote
quotient rds read readch remainder remd remflag remob remprop return reverse rplaca
rplacd sassoc set setq stringp sublis subst sub1 terpri times2 unfluid upbv vectorp wrs
= [Initially: the following list] global
It should also be remembered that in RLisp any macros with the flag EXPAND or, if FORCE is
on, without the flag NOEXPAND, are expanded before the definition is seen by the
cross-reference program, so this flag can also be used to select those macros you require
expanded and those you do not. The use of ON FORCE; is highly recommended for