| Polaris: IntConstExpr.h Source File | ||
|
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members
IntConstExpr.hGo to the documentation of this file.00001 /// 00002 #ifndef _INT_CONST_EXPR_H 00003 #define _INT_CONST_EXPR_H 00004 /// 00005 /// \class IntConstExpr 00006 /// \brief An expression representing an integer constant 00007 /// \defgroup Polaris 00008 /// \ingroup Polaris 00009 /// Expression 00010 /// \see Expression/IntConstExpr.h 00011 /// \see Expression/IntConstExpr.h 00012 /// \see Expression/Expression.cc 00013 /// 00014 /// \endcode 00015 /// \section Description Description 00016 /// An IntConstExpr represents an integer constant expression. 00017 /// 00018 #ifdef POLARIS_GNU_PRAGMAS 00019 #pragma interface 00020 #endif 00021 /// 00022 #ifndef _EXPRESSION_H 00023 #include "Expression.h" 00024 #endif 00025 /// 00026 class IntConstExpr : public Expression { 00027 friend class ExprTable; 00028 00029 public: 00030 inline IntConstExpr(int val); 00031 inline IntConstExpr(int val, int int_size); 00032 inline IntConstExpr(const IntConstExpr & e); 00033 virtual ~IntConstExpr(); 00034 00035 virtual IntConstExpr & operator = (const IntConstExpr &); 00036 00037 virtual int value() const; 00038 virtual void value(int); 00039 ///< Access the integer value of the expression. 00040 00041 virtual Expression *clone() const; 00042 virtual void print_debug(ostream & o, Boolean debug) const; 00043 virtual int structures_OK() const; 00044 virtual void convert(BinRep & exprSet, Symtab & symtab); 00045 virtual const ExprSignature & update_signature(); 00046 virtual int node_compare(const Expression & ex) const; 00047 ///< See Expression.h. 00048 00049 virtual int exchange_expr( VDL & vdl ); 00050 ///< Create a node in the "expression" member and return the index. 00051 00052 protected: 00053 int _value; 00054 00055 inline IntConstExpr(); 00056 00057 virtual Expression *_divide_by_int(int &); 00058 virtual int _gcd(void) const; 00059 virtual Boolean _args_are_equal(Expression &, 00060 Boolean consider_side_effects); 00061 }; 00062 00063 00064 ///< inline implementations 00065 00066 inline 00067 IntConstExpr::IntConstExpr() 00068 : Expression(INTEGER_CONSTANT_OP, make_type(INTEGER_TYPE)) 00069 { 00070 ///< nothing to do 00071 } 00072 00073 inline 00074 IntConstExpr::IntConstExpr(int val) 00075 : Expression(INTEGER_CONSTANT_OP, make_type(INTEGER_TYPE)) 00076 { 00077 _value = val; 00078 } 00079 00080 inline 00081 IntConstExpr::IntConstExpr(int val, int int_size) 00082 : Expression(INTEGER_CONSTANT_OP, make_type(INTEGER_TYPE, int_size)) 00083 { 00084 _value = val; 00085 } 00086 00087 inline 00088 IntConstExpr::IntConstExpr(const IntConstExpr & e) 00089 : Expression(e) 00090 { 00091 _value = e.value(); 00092 } 00093 00094 #endif |
||
|