Next: Translation of a multiarray
Up: Compilation Strategies for HPJava
Previous: Pre-translation
Contents
Basic Translation Scheme
After the pre-translator converts an HPJava program to
a suitable restricted form, the translator will start its actual
functionality. This section will introduce basic, but unoptimized
translation strategies that the current HPJava translator adopts.
Prior to describing the actual translation strategies, we will
introduce some translation functions. The detailed and specific
definitions for each will be described in the following subsections.
A function,
, on expression terms returns the result
of translating an expression
, assuming that the expression is
not a multiarray.
Translation functions for multiarray-expressions are more
complicated. In the previous section, we defined a subset
of composite multiarray-valued expressions. The remaining
non-composite multiarray-valued expressions are:
- multiarray-valued local variable access,
- multiarray-valued field access,
- conditional expression, in which the second or third operands
are multiarrays.
- assignment expression, in which the left-hand operand is a
multiarray-valued variable.
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
separate parts of the evaluation:
,
and
, ...,
,
where
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,
,
translates the statement or block
in the context of
as active
process group. In the scheme 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
should be read more precisely as
Here we will describe important translation schemata.
The full version of translation scheme for HPJava in [9]
involves perhaps a couple of dozen such schemata of varying complexity.
Subsections
Next: Translation of a multiarray
Up: Compilation Strategies for HPJava
Previous: Pre-translation
Contents
Bryan Carpenter
2004-06-09