00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef FUNCTIONPOINTERCALL_H_
00011 #define FUNCTIONPOINTERCALL_H_
00012
00013 #include "SaveInstruction.h"
00014
00015 #include<string>
00016 #include<vector>
00017 using namespace std;
00018
00019 namespace il{class node;}
00020
00021 namespace sail {
00022
00023 class Variable;
00024 class Symbol;
00025
00030 class FunctionPointerCall: public SaveInstruction {
00031 friend class boost::serialization::access;
00032
00033 template<class Archive>
00034 void serialize(Archive & ar, const unsigned int version)
00035 {
00036 ar & boost::serialization::base_object<sail::SaveInstruction>(*this);
00037 ar & ret;
00038 ar & fn_ptr;
00039 ar & args;
00040 }
00041
00042 private:
00043 Variable* ret;
00044 Variable* fn_ptr;
00045 vector<Symbol*>* args;
00046
00047 public:
00048 FunctionPointerCall(Variable* ret, Variable* fn_ptr, vector<Symbol*>* args,
00049 il::node* original, int line);
00050 FunctionPointerCall(){args = NULL;};
00051 virtual string to_string() const;
00052 virtual string to_string(bool pretty_print) const;
00053
00057 bool has_return();
00058
00063 Variable* get_return_variable();
00064 virtual Variable* get_lhs();
00065 virtual void set_lhs(Variable* v);
00066
00070 Variable* get_function_pointer();
00071
00072
00076 vector<Symbol*>* get_arguments();
00077 virtual bool is_removable();
00078 virtual ~FunctionPointerCall();
00079 };
00080
00081 }
00082
00083 #endif