Polaris: CommaExpr.h Source File

CommaExpr.h

Go to the documentation of this file.
00001 ///
00002 #ifndef _COMMA_EXPR_H
00003 #define _COMMA_EXPR_H
00004 ///
00005 /// \class CommaExpr 
00006 /// \brief An expression representing an argument list.
00007 /// \defgroup Polaris
00008 /// \ingroup Polaris
00009 ///  Expression
00010 /// \see Expression/CommaExpr.h
00011 /// \see Expression/CommaExpr.h
00012 /// \see Expression/Expression.cc
00013 ///
00014 /// \endcode
00015 /// \section Description Description
00016 /// A CommaExpr represents a comma-separated list of expressions.
00017 /// CommaExprs are typically used for representing the argument
00018 /// lists of array references or function calls.
00019 ///
00020 #ifdef POLARIS_GNU_PRAGMAS
00021 #pragma interface
00022 #endif
00023 ///
00024 #ifndef _NON_BINARY_EXPR_H
00025 #include "NonBinaryExpr.h"
00026 #endif
00027 ///
00028 class CommaExpr : public NonBinaryExpr {
00029     friend class         ExprTable;
00030 
00031  public:
00032     inline          CommaExpr();
00033     ///< Constructor for a CommaExpr with no args
00034 
00035     inline          CommaExpr(Expression * exp1,
00036                               Expression * exp2 = 0,
00037                               Expression * exp3 = 0,
00038                               Expression * exp4 = 0,
00039                               Expression * exp5 = 0);
00040     ///< Constructor for a CommaExpr with up to five args
00041 
00042     inline          CommaExpr(List<Expression> *list);
00043     ///< Creates a new CommaExpr object with the expressions in 'list'
00044     ///< as its arguments.  'list' is deleted automatically, so the user
00045     ///< must NOT delete 'list' after the call to this constructor.
00046 
00047     inline          CommaExpr(const CommaExpr & e);
00048     ///< Copy constructor
00049 
00050     virtual ~CommaExpr();
00051     ///< Virtual destructor
00052 
00053     virtual         CommaExpr & operator = (const CommaExpr &);
00054     ///< Copy assignment
00055 
00056     virtual Expression *clone() const;
00057     virtual int     structures_OK() const;
00058     virtual void    convert(BinRep & exprSet, Symtab & symtab);
00059     virtual void    print_debug(ostream & o, Boolean debug) const;
00060     ///< See Expression.h.
00061  
00062     virtual int     exchange_expr( VDL & vdl );
00063     ///< Create a node in the "expression" member and return the index.
00064 };
00065 
00066 
00067 ///< inline implementations
00068 
00069 inline
00070 CommaExpr::CommaExpr()
00071     : NonBinaryExpr(COMMA_OP, make_type(VOID_TYPE))
00072 {
00073     ///< nothing to do
00074 }
00075 
00076 inline
00077 CommaExpr::CommaExpr(Expression * exp1,
00078                      Expression * exp2 GIV(0),
00079                      Expression * exp3 GIV(0),
00080                      Expression * exp4 GIV(0),
00081                      Expression * exp5 GIV(0))
00082     : NonBinaryExpr(COMMA_OP, make_type(VOID_TYPE),
00083                     exp1, exp2, exp3, exp4, exp5)
00084 {
00085     ///< nothing to do
00086 }
00087 
00088 inline
00089 CommaExpr::CommaExpr(List<Expression>*list)
00090     : NonBinaryExpr(COMMA_OP, make_type(VOID_TYPE), list)
00091 {
00092     ///< nothing to do
00093 }
00094 
00095 inline
00096 CommaExpr::CommaExpr(const CommaExpr & e)
00097     : NonBinaryExpr(e)
00098 {
00099     ///< nothing to do
00100 }
00101 
00102 #endif
 © 1995-2005 University of Illinois, Urbana-Champaign. All rights reserved.  Fri Mar 25 23:05:42 2005