00001 #ifndef BLOCK_H_
00002 #define BLOCK_H_
00003
00004 #include "statement.h"
00005 #include <vector>
00006 using namespace std;
00007
00008
00009
00010
00011 namespace il
00012 {
00013
00014 class variable_declaration;
00015 class statement;
00016
00020 class block : public il::statement
00021 {
00022 friend class boost::serialization::access;
00023
00024 template<class Archive>
00025 void serialize(Archive & ar, const unsigned int version)
00026 {
00027 ar & boost::serialization::base_object<il::statement>(*this);
00028 ar & var_decls;
00029 ar & statements;
00030 }
00031
00032
00033 private:
00034 vector<variable_declaration*> var_decls;
00035 vector<statement*> statements;
00036
00037 public:
00038 friend ostream& operator <<(ostream &os, const block &obj);
00039 block();
00040 block(vector<variable_declaration*> & var_decls,
00041 vector<statement*> & statements);
00042 vector<variable_declaration*> & get_var_declarations();
00043 vector<statement*> & get_statements();
00044 void print();
00045 virtual ~block();
00046 virtual string to_string() const;
00047
00048 };
00049
00050 }
00051
00052 #endif