Polly 20.0.0git
python.h
Go to the documentation of this file.
1#include <set>
2#include <clang/AST/Decl.h>
3#include "generator.h"
4
5using namespace std;
6using namespace clang;
7
8class python_generator : public generator {
9private:
10 set<string> done;
11
12public:
13 python_generator(SourceManager &SM, set<RecordDecl *> &exported_types,
14 set<FunctionDecl *> exported_functions,
15 set<FunctionDecl *> functions) :
16 generator(SM, exported_types, exported_functions, functions) {}
17
18 virtual void generate();
19
20private:
21 void print(const isl_class &clazz);
22 void print_method_arguments(int first, int n_arg);
23 void print_method_header(bool is_static, const string &name, int n_arg);
24 void print_class_header(const isl_class &clazz, const string &name,
25 const vector<string> &super);
26 void print_type_check(int indent, const string &type, const char *fmt,
27 int pos, bool upcast, const string &super,
28 const string &name, int n);
29 void print_type_checks(const string &cname, FunctionDecl *method,
30 bool first_is_ctx, int n, const vector<string> &super);
31 void print_copy(QualType type);
32 void print_callback(ParmVarDecl *param, int arg);
33 void print_arg_in_call(FunctionDecl *fd, const char *fmt, int arg,
34 int skip);
35 void print_argtypes(FunctionDecl *fd);
36 void print_method_return(int indent, const isl_class &clazz,
37 FunctionDecl *method, const char *fmt);
38 void print_restype(FunctionDecl *fd);
39 void print(map<string, isl_class> &classes, set<string> &done);
40 void print_constructor(const isl_class &clazz, FunctionDecl *method);
41 void print_special_constructors(const isl_class &clazz);
42 void print_special_methods(const isl_class &clazz);
43 void print_upcast_constructors(const isl_class &clazz);
44 void print_new(const isl_class &clazz,
45 const string &python_name);
46 void print_representation(const isl_class &clazz,
47 const string &python_name);
48 void print_copy_callbacks(const isl_class &clazz);
49 void print_method_type(FunctionDecl *fd);
50 void print_method_types(const isl_class &clazz);
51 void print_get_method(const isl_class &clazz, FunctionDecl *fd);
52 void print_method(const isl_class &clazz, FunctionDecl *method,
53 vector<string> super);
54 void print_method_call(int indent, const isl_class &clazz,
55 FunctionDecl *method, const char *fmt,
56 int drop_ctx);
57 void print_argument_checks(const isl_class &clazz, FunctionDecl *fd,
58 int drop_ctx);
59 void print_method_overload(const isl_class &clazz,
60 FunctionDecl *method);
61 void print_method(const isl_class &clazz, const string &fullname,
62 const function_set &methods, vector<string> super);
63 void print_set_enum(const isl_class &clazz, FunctionDecl *fd,
64 int value, const string &name, const vector<string> &super);
65 void print_set_enum(const isl_class &clazz, FunctionDecl *fd,
66 const vector<string> &super);
67
68};
SourceManager & SM
Definition: generator.h:146
static bool is_static(const isl_class &clazz, FunctionDecl *method)
Definition: generator.cc:84
map< string, isl_class > classes
Definition: generator.h:147
python_generator(SourceManager &SM, set< RecordDecl * > &exported_types, set< FunctionDecl * > exported_functions, set< FunctionDecl * > functions)
Definition: python.h:13
void print_upcast_constructors(const isl_class &clazz)
Definition: python.cc:856
void print_argument_checks(const isl_class &clazz, FunctionDecl *fd, int drop_ctx)
Definition: python.cc:599
set< string > done
Definition: python.h:10
void print_type_check(int indent, const string &type, const char *fmt, int pos, bool upcast, const string &super, const string &name, int n)
Definition: python.cc:128
void print_set_enum(const isl_class &clazz, FunctionDecl *fd, int value, const string &name, const vector< string > &super)
Definition: python.cc:707
void print_copy(QualType type)
Definition: python.cc:190
void print_method_header(bool is_static, const string &name, int n_arg)
Definition: python.cc:96
void print_representation(const isl_class &clazz, const string &python_name)
Definition: python.cc:1014
void print_method_call(int indent, const isl_class &clazz, FunctionDecl *method, const char *fmt, int drop_ctx)
Definition: python.cc:467
void print_special_constructors(const isl_class &clazz)
Definition: python.cc:809
void print_method_overload(const isl_class &clazz, FunctionDecl *method)
Definition: python.cc:653
void print_type_checks(const string &cname, FunctionDecl *method, bool first_is_ctx, int n, const vector< string > &super)
Definition: python.cc:167
void print_new(const isl_class &clazz, const string &python_name)
Definition: python.cc:971
void print_get_method(const isl_class &clazz, FunctionDecl *fd)
Definition: python.cc:444
void print(const isl_class &clazz)
Definition: python.cc:1116
void print_method_arguments(int first, int n_arg)
Definition: python.cc:63
void print_arg_in_call(FunctionDecl *fd, const char *fmt, int arg, int skip)
Definition: python.cc:296
void print_method(const isl_class &clazz, FunctionDecl *method, vector< string > super)
Definition: python.cc:524
void print_copy_callbacks(const isl_class &clazz)
Definition: python.cc:1041
void print_constructor(const isl_class &clazz, FunctionDecl *method)
Definition: python.cc:753
virtual void generate()
Definition: python.cc:1171
void print_method_types(const isl_class &clazz)
Definition: python.cc:1070
void print(map< string, isl_class > &classes, set< string > &done)
void print_method_return(int indent, const isl_class &clazz, FunctionDecl *method, const char *fmt)
Definition: python.cc:389
void print_class_header(const isl_class &clazz, const string &name, const vector< string > &super)
Definition: python.cc:881
void print_special_methods(const isl_class &clazz)
Definition: python.cc:844
void print_method_type(FunctionDecl *fd)
Definition: python.cc:957
void print_restype(FunctionDecl *fd)
Definition: python.cc:910
void print_callback(ParmVarDecl *param, int arg)
Definition: python.cc:213
void print_argtypes(FunctionDecl *fd)
Definition: python.cc:925
std::set< FunctionDecl *, function_name_less > function_set
Definition: generator.h:45
static int n_arg(struct isl_arg *arg)
Definition: isl_arg.c:1222
static unsigned pos(__isl_keep isl_space *space, enum isl_dim_type type)
Definition: isl_map.c:70
enum isl_fold type
Definition: isl_test.c:4017
const char * name
Definition: isl_test.c:10938
const char * arg
Definition: isl_test.c:774
n
Definition: youcefn.c:8