next up previous contents index
Next: Translating variable declarations Up: Basic translation Previous: Basic translation   Contents   Index

Translation functions and schemas

We will specify several translation functions. The detailed definitions will be presented through a series of schema in the following subsections. First we give some general definitions.

A function, ${\bf T}\left[{e}\right]$, on expression terms returns the result of translating an expression $e$, assuming that the expression is not a multiarray.

Translation functions for multiarray-expressions are more complicated. In section A.3.1 we defined a subset of composite multiarray-valued expressions. The remaining non-composite multiarray-valued expressions are:

a) multiarray-valued local variable access,
b) multiarray-valued field access,
c) assignment expression, in which the left-hand operand is a multiarray-valued variable.
(this assumes that the pretranslator eliminates multiarray-valued conditional expression, as specified in Figure A.10).

The composite expressions only appear in restricted contexts and do not have translation functions in their own right (instead they are effectively handled as part of the translation of a top-level assignment statements). For non-composite multiarray-valued expressions there are $2 + R$ separate parts of the evaluation: ${\bf T}_{\mbox{\small dat}}\left[{e}\right]$, ${\bf T}_{\mbox{\small bas}}\left[{e}\right]$ and ${\bf T}_{0}\left[{e}\right]$, ..., ${\bf T}_{R-1}\left[{e}\right]$, where $R$ is the rank of the array. The interpretation of these separate terms will be given in the following sections.

Finally the translation function for statements, ${\bf T}\left[{S}\left\vert{p}\right.\right]$, translates the statement or block $S$ in the context of $p$ as active process group. In the schemas given below for translation of statements we will just use the name apg to refer to the effective active process group. Hence a schema of the form

\begin{displaymath}
\begin{minipage}[t]{\linewidth}\begin{tabbing}
\textbf{SOURC...
...extbf{TRANSLATION:} \\
\verb$ $$S'$\end{tabbing}\end{minipage}\end{displaymath}

should be read more precisely as

\begin{displaymath}
\begin{minipage}[t]{\linewidth}\begin{tabbing}
\textbf{SOURC...
...right.\right] \quad \equiv \quad S'$\end{tabbing}\end{minipage}\end{displaymath}

Figure A.13: Translation of a multiarray-valued variable declaration.
SOURCE:

\begin{displaymath}
T \verb$ [[$ \mbox{\it attr}_0 \verb$, $ \ldots \verb$, $ \m...
...-1} \verb$]] $ \mbox{\it bras} \verb$ $ a \verb$ = $e\verb$ ;$
\end{displaymath}

TRANSLATION:

\begin{displaymath}
\begin{minipage}[t]{\linewidth}\begin{tabbing}
$T$\verb$ [] ...
...{R-1}\left[{e}\right]$\verb$ ;$ \\
\end{tabbing}\end{minipage}\end{displaymath}

where:

\begin{displaymath}
\begin{array}{l}
\mbox{$T$ is a Java type,} \\
\mbox{$R$ ...
...box{{\it DIMENSION\_TYPE} are defined in the text.}
\end{array}\end{displaymath}




next up previous contents index
Next: Translating variable declarations Up: Basic translation Previous: Basic translation   Contents   Index
Bryan Carpenter 2003-04-15