00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef FIELDREFWRITE_H_
00011 #define FIELDREFWRITE_H_
00012
00013 #include "Instruction.h"
00014
00015 #include <string>
00016 using namespace std;
00017
00018 namespace il{class node;
00019 class record_info;}
00020
00021 namespace sail {
00022
00023 class Variable;
00024 class Symbol;
00025
00029 class FieldRefWrite: public Instruction{
00030 friend class boost::serialization::access;
00031
00032 template<class Archive>
00033 void serialize(Archive & ar, const unsigned int version)
00034 {
00035 ar & boost::serialization::base_object<sail::Instruction>(*this);
00036 ar & v1;
00037 ar & v2;
00038 ar & offset;
00039 ar & field_name;
00040 }
00041 private:
00042 Variable* v1;
00043 Symbol* v2;
00044 int offset;
00045 string field_name;
00046 public:
00047 FieldRefWrite(Variable* v1, Symbol* v2, int offset, il::node* original,
00048 int line);
00049 FieldRefWrite(Variable* v1, Symbol* v2,
00050 il::record_info* ri, il::node* original, int line);
00051 FieldRefWrite(Variable* v1, Symbol* v2,
00052 string & name, int offset, il::node* original, int line);
00053 FieldRefWrite(){};
00054 virtual string to_string() const;
00055 virtual string to_string(bool pretty_print) const;
00056
00061 Variable* get_lhs();
00062
00067 Symbol* get_rhs();
00068
00073 int get_offset();
00074
00080 string get_field_name();
00081 virtual bool is_removable();
00082 virtual ~FieldRefWrite();
00083 };
00084
00085 }
00086
00087 #endif