|
@@ -5898,14 +5898,24 @@ $\Rightarrow$
|
|
|
In the body of the function, all occurrances of the $i$th argument in
|
|
|
which $i>5$ must be replaced with a \code{vector-ref}.
|
|
|
|
|
|
+\section{Remove Complex Operators and Operands}
|
|
|
+\label{sec:rco-r4}
|
|
|
+
|
|
|
|
|
|
\section{Explicate Control and the $C_3$ language}
|
|
|
\label{sec:explicate-control-r4}
|
|
|
|
|
|
Figure~\ref{fig:c3-syntax} defines the syntax for $C_3$, the output of
|
|
|
-\key{explicate-control}.
|
|
|
-
|
|
|
-UNDER CONSTRUCTION
|
|
|
+\key{explicate-control}. The three mutually recursive functions for
|
|
|
+this pass, for assignment, tail, and predicate contexts, must all be
|
|
|
+updated with cases for \code{function-ref} and \code{app}. In
|
|
|
+assignment and predicate contexts, \code{app} becomes \code{call},
|
|
|
+whereas in tail position \code{app} becomes \code{tailcall}. We
|
|
|
+recommend defining a new function for processing function definitions.
|
|
|
+This code is similar to the case for \code{program} in $R_3$. The
|
|
|
+top-level \code{explicate-control} function that handles the
|
|
|
+\code{progarm} form of $R_4$ can then apply this new function to all
|
|
|
+the function definitions.
|
|
|
|
|
|
\begin{figure}[tp]
|
|
|
\fbox{
|
|
@@ -5937,11 +5947,18 @@ C_3 & ::= & (\key{program}\;\itm{info}\;\Def^{*})
|
|
|
\label{fig:c3-syntax}
|
|
|
\end{figure}
|
|
|
|
|
|
+\section{Uncover Locals}
|
|
|
+\label{sec:uncover-locals-r4}
|
|
|
+
|
|
|
+The function for processing $\Tail$ should be updated with a case for
|
|
|
+\code{tailcall}. We also recommend creating a new function for
|
|
|
+processing function definitions. Each function definition in $C_3$ has
|
|
|
+its own set of local variables, so the code for function definitions
|
|
|
+should be similar to the case for \code{program} in $C_2$.
|
|
|
|
|
|
\section{Select Instructions}
|
|
|
\label{sec:select-r4}
|
|
|
|
|
|
-
|
|
|
\margincomment{\scriptsize To do: discuss the need to push and
|
|
|
pop call-live pointers (vectors and functions)
|
|
|
to the root stack \\ --Jeremy}
|