00001 #ifndef FUNCTION_CALL_EXPRESSION_H_
00002 #define FUNCTION_CALL_EXPRESSION_H_
00003
00004 #include "expression.h"
00005 #include <vector>
00006
00007 using namespace std;
00008
00009 namespace il
00010 {
00011
00015 class function_call_expression : public expression
00016 {
00017 friend class boost::serialization::access;
00018
00019 template<class Archive>
00020 void save(Archive & ar, const unsigned int version) const
00021 {
00022 ar & boost::serialization::base_object<il::expression>(*this);
00023 ar & fn_name;
00024 ar & ns;
00025 ar & fn_signature;
00026 ar & args;
00027 ar & is_no_return;
00028 ar & is_alloc;
00029 ar & operator_new;
00030 ar & is_dealloc;
00031 ar & constructor;
00032 ar & destructor;
00033 }
00034
00035 template<class Archive>
00036 void load(Archive & ar, const unsigned int version)
00037 {
00038 ar & boost::serialization::base_object<il::expression>(*this);
00039 ar & fn_name;
00040 ar & ns;
00041 ar & fn_signature;
00042 type::register_loaded_typeref(&fn_signature);
00043 ar & args;
00044 ar & is_no_return;
00045 ar & is_alloc;
00046 ar & operator_new;
00047 ar & is_dealloc;
00048 ar & constructor;
00049 ar & destructor;
00050 }
00051
00052 BOOST_SERIALIZATION_SPLIT_MEMBER()
00053
00054 private:
00055 string fn_name;
00056 namespace_context ns;
00057 type* fn_signature;
00058 vector<expression*> args;
00059 bool is_no_return;
00060 bool is_alloc;
00061 bool operator_new;
00062 bool is_dealloc;
00063 bool constructor;
00064 bool destructor;
00065
00066
00073 expression *vtable_lookup_expr;
00074
00080 long int vtable_index;
00081
00082
00083 public:
00084 function_call_expression();
00085 function_call_expression(string fn_name,
00086 namespace_context ns,
00087 type *fn_signature,
00088 vector<expression *> &args,
00089 type *t,
00090 bool is_no_return,
00091 bool is_alloc,
00092 bool is_operator_new,
00093 bool is_dealloc,
00094 bool is_constructor,
00095 bool is_destructor,
00096 expression *vtable_lookup_expr,
00097 long int vtable_index,
00098 location loc);
00099
00100 virtual string to_string() const;
00101
00105 virtual string get_function();
00106
00111 virtual type* get_signature();
00112
00117 const namespace_context & get_namespace();
00118
00123 virtual vector<expression*>& get_arguments();
00124
00128 bool is_exit_function();
00129
00133 bool is_allocator();
00134
00138 bool is_operator_new();
00139
00143 bool is_deallocator();
00144
00148 bool is_constructor();
00149
00150
00154 bool is_destructor();
00155
00156
00157 bool is_call_to_virtual() const;
00158
00164 bool has_return();
00165
00166 expression *get_vtable_lookup_expr();
00167
00168 int get_vtable_index();
00169
00170 virtual ~function_call_expression();
00171 };
00172
00173 }
00174
00175 #endif