|
@@ -3553,21 +3553,22 @@ The \key{map2} function ...
|
|
The \code{make-graph}, \code{add-edge}, and \code{adjacent}
|
|
The \code{make-graph}, \code{add-edge}, and \code{adjacent}
|
|
functions...
|
|
functions...
|
|
|
|
|
|
-The \key{interp-tests} function takes a compiler name (a string) a
|
|
|
|
-description of the passes a test family name (a string), and a list of
|
|
|
|
-test numbers, and runs the compiler passes and the interpreters to
|
|
|
|
-check whether the passes correct. The description of the passes is a
|
|
|
|
-list with one entry per pass. An entry is a list with three things: a
|
|
|
|
-string giving the name of the pass, the function that implements the
|
|
|
|
-pass (a translator from AST to AST), and a function that implements
|
|
|
|
-the interpreter (a function from AST to result value). The
|
|
|
|
-interpreters from Appendix~\ref{appendix:interp} make a good choice.
|
|
|
|
-The \key{interp-tests} function assumes that the subdirectory
|
|
|
|
-\key{tests} has a bunch of Scheme programs whose names all start with
|
|
|
|
-the family name, followed by an underscore and then the test number,
|
|
|
|
-ending in \key{.scm}. Also, for each Scheme program there is a file
|
|
|
|
-with the same number except that it ends with \key{.in} that provides
|
|
|
|
-the input for the Scheme program.
|
|
|
|
|
|
+The \key{interp-tests} function takes a compiler name (a string), a
|
|
|
|
+description of the passes, an interpreter for the source language, a
|
|
|
|
+test family name (a string), and a list of test numbers, and runs the
|
|
|
|
+compiler passes and the interpreters to check whether the passes
|
|
|
|
+correct. The description of the passes is a list with one entry per
|
|
|
|
+pass. An entry is a list with three things: a string giving the name
|
|
|
|
+of the pass, the function that implements the pass (a translator from
|
|
|
|
+AST to AST), and a function that implements the interpreter (a
|
|
|
|
+function from AST to result value) for the language of the output of
|
|
|
|
+the pass. The interpreters from Appendix~\ref{appendix:interp} make a
|
|
|
|
+good choice. The \key{interp-tests} function assumes that the
|
|
|
|
+subdirectory \key{tests} has a bunch of Scheme programs whose names
|
|
|
|
+all start with the family name, followed by an underscore and then the
|
|
|
|
+test number, ending in \key{.scm}. Also, for each Scheme program there
|
|
|
|
+is a file with the same number except that it ends with \key{.in} that
|
|
|
|
+provides the input for the Scheme program.
|
|
\begin{lstlisting}
|
|
\begin{lstlisting}
|
|
(define (interp-tests name passes test-family test-nums) ...
|
|
(define (interp-tests name passes test-family test-nums) ...
|
|
\end{lstlisting}
|
|
\end{lstlisting}
|