Polaris: DoExpr.h Source File

DoExpr.h

Go to the documentation of this file.
00001 ///
00002 #ifndef _DO_EXPR_H
00003 #define _DO_EXPR_H
00004 ///
00005 /// \class DoExpr 
00006 /// \brief A derived class from Expression
00007 /// \defgroup Polaris
00008 /// \ingroup Polaris
00009 ///  Expression
00010 /// \see Expression/DoExpr.h
00011 /// \see Expression/DoExpr.h
00012 /// \see Expression/Expression.cc
00013 ///
00014 /// \endcode
00015 /// \section Description Description
00016 /// A DoExpr is the loop-like structure in an I/O statement
00017 /// with an index and an iterator-expression: "( A(I), I=1,100,3)".
00018 ///
00019 /// USE:
00020 /// iolist must be a CommaExpr
00021 /// iterator must be an EqualExpr
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 DoExpr    : public BinaryExpr {
00032     friend class          ExprTable;
00033 
00034  public:
00035     inline DoExpr(Expression * iolist_exp, Expression * iterator_exp);
00036     inline DoExpr(const DoExpr & e);
00037     virtual ~DoExpr();
00038 
00039     virtual DoExpr & operator = (const DoExpr &);
00040 
00041     const Expression & iolist() const;
00042     Expression &    iolist();
00043     void            iolist(Expression *);
00044     ///< Return a list of array references accessed by this expression.
00045     ///< The iolist must always be a CommaExpr.
00046 
00047     const Expression &    iterator() const;
00048     Expression &    iterator();
00049     void            iterator(Expression *);
00050     ///< Return the iterator of the expression.  The iterator must be
00051     ///< an EqualExpr.
00052 
00053     virtual Expression *clone() const;
00054     virtual int     structures_OK() const;
00055     virtual void    convert(BinRep & exprSet, Symtab & symtab);
00056     virtual void    print_debug(ostream & o, Boolean debug) const;
00057     ///< See Expression.h.
00058  
00059     virtual int     exchange_expr( VDL & vdl );
00060     ///< Create a node in the "expression" member and return the index.
00061 
00062  protected:
00063     inline DoExpr();
00064 };
00065 
00066 
00067 ///< inline implementations
00068 
00069 inline
00070 DoExpr::DoExpr()
00071 : BinaryExpr(DO_OP, make_type(VOID_TYPE)) 
00072 {
00073     ///< nothing to do
00074 }
00075 
00076 inline
00077 DoExpr::DoExpr(Expression * iolist_exp, Expression * iterator_exp)
00078 : BinaryExpr(DO_OP, make_type(VOID_TYPE), iolist_exp, iterator_exp) 
00079 {
00080     p_assert(iolist_exp->op() == COMMA_OP
00081          || iolist_exp->is_wildcard(),
00082          "DoExpr( ): iolist not a CommaExpr");
00083     p_assert(iterator_exp->op() == EQUAL_OP
00084          || iterator_exp->is_wildcard(),
00085          "DoExpr( ): iterator not a EqualExpr");
00086 }
00087 
00088 inline
00089 DoExpr::DoExpr(const DoExpr & e)
00090 : BinaryExpr(e) 
00091 {
00092     ///< nothing to do
00093 }
00094 
00095 #endif
 © 1995-2005 University of Illinois, Urbana-Champaign. All rights reserved.  Fri Mar 25 23:05:45 2005