00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef FIELDREFREAD_H_
00013 #define FIELDREFREAD_H_
00014
00015 #include "SaveInstruction.h"
00016
00017 #include <string>
00018 using namespace std;
00019
00020 namespace il{class node;
00021 class record_info;
00022 }
00023
00024 namespace sail {
00025
00026 class Variable;
00027
00035 class FieldRefRead: public SaveInstruction {
00036 friend class boost::serialization::access;
00037
00038 template<class Archive>
00039 void serialize(Archive & ar, const unsigned int version)
00040 {
00041 ar & boost::serialization::base_object<sail::SaveInstruction>(*this);
00042 ar & v1;
00043 ar & v2;
00044 ar & offset;
00045 ar & field_name;
00046 }
00047
00048 private:
00049 Variable* v1;
00050 Variable* v2;
00051 int offset;
00052 string field_name;
00053 public:
00054 FieldRefRead(Variable* v1, Variable* v2, int offset, il::node* original,
00055 int line);
00056 FieldRefRead(Variable* v1, Variable* v2, int offset, string field_name,
00057 il::node* original, int line);
00058 FieldRefRead(Variable* v1, Variable* v2, il::record_info* ri,
00059 il::node* original, int line);
00060 FieldRefRead(){};
00061 virtual string to_string() const;
00062 virtual string to_string(bool pretty_print) const;
00063 virtual Variable* get_lhs();
00064 virtual void set_lhs(Variable* v);
00065
00069 Variable* get_rhs();
00070
00075 int get_offset();
00076
00082 string get_field_name();
00083 virtual bool is_removable();
00084 virtual ~FieldRefRead();
00085 };
00086
00087 }
00088
00089 #endif