00001 #ifndef FILE_H_
00002 #define FILE_H_
00003
00004
00005 #include "node.h"
00006 #include <string>
00007
00008
00009 namespace il
00010 {
00011
00012 class function_declaration;
00013 class declaration;
00014 class assembly;
00018 class file:public node
00019 {
00020 friend class boost::serialization::access;
00021
00022 template<class Archive>
00023 void serialize(Archive & ar, const unsigned int version)
00024 {
00025 ar & boost::serialization::base_object<il::node>(*this);
00026 ar & file_name;
00027 ar & declarations;
00028 ar & init_func;
00029 ar & glob_asm;
00030 }
00031 private:
00032
00033
00034
00035 string file_name;
00036
00037
00038
00039
00040 vector<declaration*> declarations;
00041
00042
00043
00044
00045 function_declaration* init_func;
00046
00047
00048
00049
00050 assembly* glob_asm;
00051
00052
00053
00054 public:
00055 file();
00056 file(string file_name);
00057
00058
00059
00060 void add_declaration(declaration * decl);
00061 void set_initfunc(function_declaration* init_func);
00062 void set_globasm(assembly* glob_asm);
00063
00068 vector<declaration*> & get_declarations();
00069
00075 function_declaration * get_initfunc();
00076
00080 assembly *get_globasm();
00081 virtual string to_string() const;
00082 string get_name();
00083
00084 virtual ~file();
00085 virtual void print();
00086 };
00087
00088 }
00089
00090 #endif