00001 #ifndef CONDITIONAL_EXPRESSION_H_
00002 #define CONDITIONAL_EXPRESSION_H_
00003
00004 #include "expression.h"
00005 #include "statement.h"
00006
00007 namespace il
00008 {
00009 class type;
00010
00014 class conditional_expression:public expression
00015 {
00016 friend class boost::serialization::access;
00017
00018 template<class Archive>
00019 void serialize(Archive & ar, const unsigned int version)
00020 {
00021 ar & boost::serialization::base_object<il::expression>(*this);
00022 ar & cond;
00023 ar & then_clause;
00024 ar & else_clause;
00025 }
00026
00027
00028 private:
00029 expression* cond;
00030 expression* then_clause;
00031 expression* else_clause;
00032
00033 public:
00034 conditional_expression();
00035 conditional_expression(expression* cond, expression* then_clause,
00036 expression* else_clause, type* t, location loc);
00037 virtual string to_string() const;
00038 virtual expression* get_conditional();
00039 virtual expression* get_then_clause();
00040 virtual expression* get_else_clause();
00041 virtual ~conditional_expression();
00042 };
00043
00044 }
00045
00046 #endif