next up previous contents index
Next: Basic translation Up: Applying the simplify algorithm Previous: on statements   Contents   Index

at and overall statements

We consider the statement

\verb$at($$i$\verb$ = $$x$\verb$ [$$n$\verb$]) $$S$\end{tabbing}\end{minipage}\end{displaymath}

where $x$ and $n$ are expressions and $S$ is a statement.

Apply the simplify algorithm to the ordered list $[x, n]$ (in this case treating $x$ as a multiply reference value) and let the results be $\mbox{\it INITS}$ and $[x',n']$. If $\mbox{\it INITS}$ is empty the transformed version of our at statement is just

\verb$at($$i$\verb$ = $$x$\verb$ [$$n$\verb$]) $$S'$\end{tabbing}\end{minipage}\end{displaymath}

where $S'$ is the pre-translated version of $S$. Otherwise the transformed version is

\verb${$ \\
... [$$n'$\verb$]) $$S'$ \\

The overall statement follows the same pattern, if the triplet $t$ in

...b$ = $$x$\verb$ for $$t$\verb$) $$S$\end{tabbing}\end{minipage}\end{displaymath}

is treated as a generalized kind of expression.

Bryan Carpenter 2003-04-15