Polaris: LabelExpr.h Source File

LabelExpr.h

Go to the documentation of this file.
00001 ///
00002 #ifndef _LABEL_EXPR_H
00003 #define _LABEL_EXPR_H
00004 ///
00005 /// \class LabelExpr 
00006 /// \brief An expression representing a statement label reference
00007 /// \defgroup Polaris
00008 /// \ingroup Polaris
00009 ///  Expression
00010 /// \see Expression/LabelExpr.h
00011 /// \see Expression/LabelExpr.h
00012 /// \see Expression/Expression.cc
00013 ///
00014 /// \endcode
00015 /// \section Description Description
00016 /// A LabelExpr is a reference to a statement label in an s_control_type
00017 /// and simply contains a reference to a Statement.
00018 ///
00019 #ifdef POLARIS_GNU_PRAGMAS
00020 #pragma interface
00021 #endif
00022 ///
00023 #ifndef _EXPRESSION_H
00024 #include "Expression.h"
00025 #endif
00026 ///
00027 class LabelExpr : public Expression {
00028  public:
00029     inline LabelExpr(Statement & stmt);
00030     inline LabelExpr(const LabelExpr & e);
00031     virtual ~LabelExpr();
00032 
00033     virtual LabelExpr & operator = (const LabelExpr & e);
00034 
00035     const Statement &     stmt() const;
00036     Statement &     stmt();
00037     void            stmt(Statement & stmt);
00038     ///< Access the statement label represented by this expression.
00039 
00040     virtual void    relink_eptrs(ProgramUnit & p);
00041     ///< Change pointer in LabelExpr to point into the given ProgramUnit
00042     virtual Expression *clone() const;
00043     virtual void    print_debug(ostream & o, Boolean debug) const;
00044     virtual int     structures_OK() const;
00045     virtual void    convert(BinRep & exprSet, Symtab & symtab);
00046     virtual const ExprSignature & update_signature();
00047     virtual int     node_compare(const Expression & ex) const;
00048     ///< See Expression.h.
00049  
00050     virtual int     exchange_expr( VDL & vdl );
00051     ///< Create a node in the "expression" member and return the index.
00052 
00053  protected:
00054     Statement * _stmt;
00055 };
00056 
00057 
00058 ///< inline implementations
00059 
00060 inline
00061 LabelExpr::LabelExpr(Statement & stmt)
00062     : Expression(LABEL_OP, make_type(VOID_TYPE)) 
00063 {
00064     _stmt = &stmt;
00065 }
00066 
00067 inline
00068 LabelExpr::LabelExpr(const LabelExpr & e)
00069     : Expression(e) 
00070 {
00071     _stmt = e._stmt;
00072 }
00073 
00074 #endif
 © 1995-2005 University of Illinois, Urbana-Champaign. All rights reserved.  Fri Mar 25 23:05:57 2005