next up previous contents index
Next: Explicit constructor invocation statements Up: Applying the simplify algorithm Previous: for statements   Contents   Index


return and throw statements

Consider the statement

\begin{displaymath}
\begin{minipage}[t]{\linewidth}\begin{tabbing}
\verb$return $$e$\verb$ ;$
\end{tabbing}\end{minipage}\end{displaymath}

where $e$ is an expression. As usual, $\mbox{\it INITS}$ and $e'$ are the results of applying the simplify algorithm to $e$. If $e' = e$, i.e. no simplification is required, the statement is untransformed. Otherwise the transformed version is

\begin{displaymath}
\begin{minipage}[t]{\linewidth}\begin{tabbing}
\verb${$ \\
...
...$return $$e'$\verb$ ;$ \\
\verb$}$
\end{tabbing}\end{minipage}\end{displaymath}

The throw statement follows exactly the same pattern.



Bryan Carpenter 2003-04-15