D Refal Tracer

The tracer prints out ground expressions from the view field in a code which is an extension of the `expression-exchange' code (see Sec.2.3):

  in the view field              printed as	
  
  s.Identifier             #e.Char-string   blank 
    s.Number               #e.Char-string   blank 
        (                           (
        )                           )
        <                           <
        >                           >
        '('                        #(
        ')'                        #)
        '<'                        #<
        '>'                        #>
        '#'                        ##
  unknown(t,n,i)                  #t.ni


Identifiers are printed in capital letters.

To call the Refal tracer, use reftr (see Reference Section A). The list of tracer commands is given below. At the beginning of work and after execution of each command (except quit ), the tracer prints out the prompt:

TRACE>

Command names and parameters may appear in either upper or lower case (except in pattern specification P, where the case is important). Command parameters may be separated by blanks, tabs, or commas (we use blanks in the list below). Commands are separated by end-of-lines or semicolons. To continue the command on the next line type a backslash '\' at the end.

In the list below, the shortened command names and keywords are indicated in parentheses; optional parameters are enclosed in square brackets.

Tracer Commands

set_break(set,break) <F P>


where F is a function currently defined (in any of the modules used) and P is a pattern of its argument. The command sets a break point. Tracer will stop when the active function is F and its argument matches P.


print(pr,p) value

prints value as defined at the moment. The value parameter may be:

view(v) prints the current view field.
a Refal variable prints the value of the variable as it is defined at the current break point.
act prints the current active expression.
result(res) prints the result of the commands compute or step.
call prints the active expression which was called to produce the current replacement - applicable only after step or compute.

quit(q)

Stops the Refal machine and exits from the tracer.
exit(ex)

The same as quit but some information is printed out: the number of steps, the view field etc.
go

Resumes execution until the next break point or the end of run.
compute(comp,com) [result(res)]

Computes the current active expression and stops. If result or res is present, the result is printed out upon completion.
delete(del,d) N

Deletes break point number N.
step(s) N [result(res)]

Makes N steps and stops. If N is not there, N = 1 . If result is present and N = 1 , the result of the step is printed.
show(sho,sh) key

Shows some of the current features of the computation process. The key parameter may be:

step prints the current step number.
pointprints the current break point.
[break] Nprints break point number N.
all prints all break points.
modules(mod) [name]
 
 
Prints all functions visible from the module name. If '*' is given as name, then all modules are displayed. If no name is given, only the list of accessible modules is printed.
function(fun) name Prints the name of the module where the function name is defined.

help

Prints the list of tracer commands.
. [N]

The period command repeats N times the last batch of commands appearing on the same line. Absent N means N = 1. The period must appear in the first position in the line.