00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef ASSIGNMENT_H_
00016 #define ASSIGNMENT_H_
00017
00018 #include "SaveInstruction.h"
00019
00020 #include <string>
00021 using namespace std;
00022
00023 namespace il{class node;}
00024
00025 namespace sail {
00026
00027 class Symbol;
00028 class Variable;
00029
00033 class Assignment: public SaveInstruction {
00034
00035 friend class boost::serialization::access;
00036
00037 template<class Archive>
00038 void serialize(Archive & ar, const unsigned int version)
00039 {
00040 ar & boost::serialization::base_object<sail::SaveInstruction>(*this);
00041 ar & v;
00042 ar & s;
00043 }
00044 private:
00045 Variable* v;
00046 Symbol* s;
00047
00048
00049 public:
00050 Assignment(Variable* v, Symbol* s, il::node* original, int line);
00051 Assignment(){};
00052 virtual string to_string() const;
00053 virtual string to_string(bool pretty_print) const;
00054 virtual Variable* get_lhs();
00055 virtual void set_lhs(Variable* v);
00056 Symbol* get_rhs();
00057 virtual bool is_removable();
00058
00059
00060
00061
00062
00063 il::node* get_original_node();
00064 virtual ~Assignment();
00065 };
00066
00067 }
00068
00069 #endif