00001 #ifndef FOR_LOOP_H_
00002 #define FOR_LOOP_H_
00003
00004 #include "control_statement.h"
00005 #include <assert.h>
00006
00007
00008 namespace il
00009 {
00010 class expression;
00011 class statement;
00012
00016 class for_loop : public il::control_statement
00017 {
00018 friend class boost::serialization::access;
00019
00020 template<class Archive>
00021 void serialize(Archive & ar, const unsigned int version)
00022 {
00023 ar & boost::serialization::base_object<il::control_statement>(*this);
00024 ar & init;
00025 ar & continue_cond;
00026 ar & update;
00027 ar & body;
00028 }
00029 private:
00030 expression* init;
00031 expression* continue_cond;
00032 expression* update;
00033 statement* body;
00034
00035
00036 public:
00037 for_loop();
00038 for_loop(expression* init, expression* continue_cond, expression* update,
00039 statement* body, location loc);
00040
00045 expression* get_continuation_cond();
00046
00051 expression* get_update_expression();
00052
00057 statement* get_body();
00058 void print();
00059 virtual ~for_loop();
00060 virtual string to_string() const;
00061 };
00062
00063 }
00064
00065 #endif