00001 #ifndef IF_STATEMENT_H_
00002 #define IF_STATEMENT_H_
00003
00004 #include "control_statement.h"
00005
00006
00007 namespace il
00008 {
00009
00013 class if_statement : public il::control_statement
00014 {
00015 friend class boost::serialization::access;
00016
00017 template<class Archive>
00018 void serialize(Archive & ar, const unsigned int version)
00019 {
00020 ar & boost::serialization::base_object<il::control_statement>(*this);
00021 ar & test;
00022 ar & if_branch;
00023 ar & else_branch;
00024 }
00025 private:
00026 expression* test;
00027 statement* if_branch;
00028 statement* else_branch;
00029 public:
00030 if_statement(expression* test, statement* if_branch,
00031 statement* else_branch, location loc);
00032 if_statement();
00033 void print();
00034 expression* get_test();
00035 statement* get_if_statement();
00036 statement* get_else_statement();
00037 virtual ~if_statement();
00038 virtual string to_string() const;
00039
00040 };
00041
00042 }
00043
00044 #endif