00001 #ifndef UNOP_EXPRESSION_H_
00002 #define UNOP_EXPRESSION_H_
00003
00004 #include "expression.h"
00005
00006 namespace il
00007 {
00008
00009
00010
00011
00012
00013 enum unop_type{
00014 _NEGATE,
00015 _CONJUGATE,
00016 _PREDECREMENT, _PREINCREMENT,
00017 _POSTDECREMENT, _POSTINCREMENT,
00018 _BITWISE_NOT,
00019 _LOGICAL_NOT,
00020 _VEC_UNOP
00021 };
00022
00026 class unop_expression : public il::expression
00027 {
00028 friend class boost::serialization::access;
00029
00030 template<class Archive>
00031 void serialize(Archive & ar, const unsigned int version)
00032 {
00033 ar & boost::serialization::base_object<il::expression>(*this);
00034 ar & inner_exp;
00035 ar & unop;
00036 }
00037 private:
00038 expression* inner_exp;
00039 unop_type unop;
00040 public:
00041 unop_expression();
00042 unop_expression(expression* inner_exp, unop_type unop,
00043 type* t, location loc);
00044 virtual string to_string() const;
00045 virtual expression* get_operand();
00046 virtual unop_type get_operator();
00047 virtual bool is_vector_unop();
00048 virtual bool is_postop() const;
00049 static string unop_to_string(unop_type op, bool* need_paren);
00050 virtual bool has_side_effect();
00051 virtual ~unop_expression();
00052 };
00053
00054 }
00055
00056 #endif