[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



Masterscope now notes which functions use which iterative statementnew features in Masterscope:


operators. The command language allows "AS [A] CLISP WORD" as a 
modifier to USE. Examples:
	. SHOW WHERE ANY USE collect AS A CLISP WORD
	. WHICH CLISP WORDS ARE USED BY MYFN
Valid synonyms: CLISPWORD = I.S.OPR = CLISP WORD
----------------------------------------------------------------------
The USE of record FIELDS has been split into FETCH of those fields
and REPLACE, with USE AS A FIELD the union of those.

E.g.
	. WHO FETCHES FOO
will give the list of functions which do a (fetch FOO --) while
	. WHO REPLACES FOO
will give a list of the functions which do a (replace FOO --).
----------------------------------------------------------------------
the <set>
	LIKE <pattern>
will treat <pattern> as a edit pattern if it has alt-modes in it...e.g.
	. SHOW WHERE FOO CALLS ANY LIKE /$
will print out all of the places where a function whose name begins
with a "/" is called.
---------------------------------------------------------------------
the <set>
	FIELDS OF <records> 
denotes all of the record fields of <records>,  e.g.
	. WHO USES ANY FIELDS OF BRECORD
returns the list of all functions which do a fetch or replace with any of
the field names declared in the record declaration of BRECORD.
	. WHO USES ANY FIELDS OF ANY RECORDS ON ACOMP
gives the functions which use any field of any record on ACOMP.
---------------------------------------------------------------------
Masterscope knows more about blocks declarations:
You can talk about sets of things in blocks declarations. I.e.,
a <set> may also be:
	<blockword> [ON <files>] [OF <functions>]
where <blockword> is one of ENTRIES, LOCALVARS, SPECVARS, LOCALFREEVARS,
GLOBALVARS, BLKFNS, BLKAPPLYFNS. For example:
	ENTRIES ON MASTERSCOPE 
means all of the entries of all of the blocks on the file Masterscope.
	ENTRIES OF MSPARSE 
means the entries of the block which contains MSPARSE (MSPARSE could be
the block name or one of the actual functions).

The words OF and ON in this syntax may be followed by <sets>, e.g.
	ENTRIES OF ANY USING THE FIELD X
For GLOBALVARS, SPECVARS, etc, the "ON" phrase will also
find the ones that are in the fileCOMS, e.g.
	GLOBALVARS ON MASTERSCOPE
means all of the GLOBALVARS of any block plus those dumped with the
GLOBALVARS prettydef command.
---------------------------------------------------------------------
In addition, Masterscope contains a fairly comprehensive checker for
blocks declarations (as well as a few other anomolous conditions).
The command:
	. CHECK <files>
will (a) analyze all of the functions on the file(s) given, if necessary.
(b) read the blocks declaration and check for
  Things not properly declared ENTRIES (e.g. if no one in the block
calls a function, and it isn't an entry (or a BLKAPPLYFN) there is no
way to get to it).
  Variables declared improperly (checks LOCALFREEVAR declarations to make
sure vars are bound above where they are used, for the deep-bound system,
checks SPECVARS to see if they are used below where they are bound, for the
shallow system).
  Variables used freely and not declared (often an error).

Note that Masterscope checks for various problems even in the absence of 
BLOCKS declarations

Suggestions for additional checks are welcome.
---------------------------------------------------------------------
The EDIT command can be followed by a - and a list of edit commands,
for example:
	. EDIT WHERE MYFN CALLS RPLACA - (R RPLACA FRPLACA)
--------------------------------------------------------------------
Note that there are two forms of the EDIT command:
	. EDIT [WHERE] <set> <verbs> <set> [- <edit commands>]
and
	. EDIT <set> [- <edit commands>]
The latter just calls EDITF on each element of <set>. For example:
	. EDIT WHERE ANY CALLS Y
will edit the expressions where Y is called.
	. EDIT ANY CALLING Y
will just call EDITF on the functions that call Y.
----------------------------------------------------------------------
Masterscope allows a command of the form:
	. FOR <variable> <set> <clisptail> 
which will execute the iterative statment:
	(FOR <variable> IN '(elements of <set>)  <clisptail>)
For example:
	. FOR X CALLING Y DO (PRINT X)
will print on separate lines the names of the functions which call Y
	. FOR X ON MYFILE AND BINDING Z DO (UNSAVEDEF X)
will call UNSAVEDEF on the functions on the file MYFILE which bind the
variable Z.
----------------------------------------------------------------------
The command
	. COMPONENTS <set>
will print out a list of the "connected components" of <set> (or everybody
if you don't give a set). The connected components are such that
if functions are in different components then there is no way to get
from one to the other, nor do they call common sub-functions or
do they have common callers.
----------------------------------------------------------------------
Questions with more than one question element in them, for example
	. WHO USES WHO FREELY
	. WHICH FNS ON MYFILE CALL WHO NOT @ GETD
work much better now.
----------------------------------------------------------------------
Relative clauses:
another way of saying a <set> is via a "relative clause", introduced
by one of the relative pronoun words THAT, WHICH, or WHO, i.e. a <set>
may also be:
	<rel.pro> <verbs> <set>
	<rel.pro> IS/ARE <set>
e.g. 
	. EDIT WHERE X USES ANY THAT ARE BOUND BY Y
	. FOR X THAT BINDS Z DO (PRINT Z)
	. WHICH FUNCTIONS WHICH BIND Z OR ARE CALLED BY Y
	...ARE CALLED SOMEHOW BY X
---------------------------------------------------------------------
subject/verb inversion:
you can ask questions of the form
	. DOES <set> <verb> <set>
	. IS <set> <set>
e.g.
	. DOES X BIND Y
	. IS FOO CALLED SOMEHOW BY Z
As usual DOES=DO, ARE=IS
--------------------------------------------------------------------
ALL masterscope commands may now be followed by the phrase
"OUTPUT filename" to have the results of the command printed on the
given file. For example,
. DESCRIBE THE FUNCTIONS ON MYFILE OUTPUT LPT:
or
. WHO ON MYFILE CALLS WHO LIKE /$ OUTPUT UNDOABLE.LIST
-------