next up previous contents
Next: MultiDimArrayExpression Up: Data Structure Access Functions Previous: Data Structure Access Functions   Contents


ArrayReferenceExpression

An ArrayReferenceExpression represents the calculation of an array element address from an array address and an integer index expression.

    concrete ArrayReferenceExpression : Expression
      {
        Expression * owner base_array_address in source_ops;
        Expression * owner index in source_ops;
      };

base_array_address a pointer to an array (having the correct arrary type) and the result_type must be a pointer to the element type of that array_type.
index index of the array element of interest. The address of the array element is:

\begin{displaymath}
\texttt{{base\_array\_address}} + \texttt{{index}} + *
\texttt{{element\_size}}
\end{displaymath}

where element_size is calculated from the element type of the ArrayType stored in the base_array_address result type. The result_type of the index expression must be an IntegerType.



SUIF Nightly Build
2000-08-14