ArrayRefExpr.hGo to the documentation of this file.00001
00002 #ifndef _ARRAY_REF_EXPR_H
00003 #define _ARRAY_REF_EXPR_H
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifdef POLARIS_GNU_PRAGMAS
00024 #pragma interface
00025 #endif
00026
00027 #ifndef _BINARY_EXPR_H
00028 #include "BinaryExpr.h"
00029 #endif
00030
00031 class DDgraph;
00032
00033 class ArrayRefExpr : public BinaryExpr {
00034 friend class ExprTable;
00035 friend class DDgraph;
00036
00037 public:
00038 inline ArrayRefExpr(const Type & etype, Expression * array_exp,
00039 Expression * subscript_exp);
00040 inline ArrayRefExpr(const ArrayRefExpr & e);
00041 virtual ~ArrayRefExpr();
00042
00043 virtual ArrayRefExpr & operator = (const ArrayRefExpr &);
00044
00045 const Expression & array() const {
00046 return _left_guarded();
00047 }
00048
00049 Expression & array() {
00050 return _left_guarded();
00051 }
00052
00053 virtual void array(Expression *);
00054
00055
00056
00057 inline const Expression & subscript() const {
00058 return _right_guarded();
00059 }
00060
00061 inline Expression & subscript() {
00062 return _right_guarded();
00063 }
00064 virtual void subscript(Expression *);
00065
00066
00067
00068 virtual Expression *clone() const;
00069 virtual int structures_OK() const;
00070 virtual void convert(BinRep & exprSet, Symtab & symtab);
00071 virtual void print_debug(ostream & o, Boolean debug) const;
00072 virtual const Symbol *base_variable_ref() const;
00073 virtual Symbol *base_variable_ref();
00074
00075
00076 virtual int exchange_expr( VDL & vdl );
00077
00078
00079 protected:
00080 Arc_type *_arcs;
00081
00082 inline ArrayRefExpr(const Type & etype);
00083 };
00084
00085
00086
00087
00088
00089 inline
00090 ArrayRefExpr::ArrayRefExpr(const Type & etype)
00091 : BinaryExpr(ARRAY_REF_OP, etype)
00092 {
00093 _arcs = 0;
00094 }
00095
00096 inline
00097 ArrayRefExpr::ArrayRefExpr(const Type & etype, Expression * array_exp,
00098 Expression * subscript_exp)
00099 : BinaryExpr(ARRAY_REF_OP, etype, array_exp, subscript_exp)
00100 {
00101 p_assert(array_exp->op() == ID_OP
00102 || array_exp->is_wildcard(),
00103 "ArrayRefExpr( ):'array' expression not an IDExpr");
00104 p_assert(subscript_exp->op() == COMMA_OP
00105 || subscript_exp->is_wildcard(),
00106 "ArrayRefExpr( ):'subscript' expression not a CommaExpr");
00107 _arcs = 0;
00108 }
00109
00110 inline
00111 ArrayRefExpr::ArrayRefExpr(const ArrayRefExpr & e)
00112 : BinaryExpr(e)
00113 {
00114 _arcs = 0;
00115 }
00116
00117 #endif
|