2 #include <clang/AST/Decl.h>
8 class python_generator
: public generator
{
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
) {}
18 virtual void generate();
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(const string
&type
, int pos
, bool upcast
,
27 const string
&super
, const string
&name
, int n
);
28 void print_type_checks(const string
&cname
, FunctionDecl
*method
,
29 bool first_is_ctx
, int n
, const vector
<string
> &super
);
30 void print_copy(QualType type
);
31 void print_callback(ParmVarDecl
*param
, int arg
);
32 void print_arg_in_call(FunctionDecl
*fd
, int arg
, int skip
);
33 void print_argtypes(FunctionDecl
*fd
);
34 void print_method_return(int indent
, const isl_class
&clazz
,
35 FunctionDecl
*method
);
36 void print_restype(FunctionDecl
*fd
);
37 void print(map
<string
, isl_class
> &classes
, set
<string
> &done
);
38 void print_constructor(const isl_class
&clazz
, FunctionDecl
*method
);
39 void print_upcast_constructors(const isl_class
&clazz
);
40 void print_new(const isl_class
&clazz
,
41 const string
&python_name
);
42 void print_representation(const isl_class
&clazz
,
43 const string
&python_name
);
44 void print_copy_callbacks(const isl_class
&clazz
);
45 void print_method_type(FunctionDecl
*fd
);
46 void print_method_types(const isl_class
&clazz
);
47 void print_get_method(const isl_class
&clazz
, FunctionDecl
*fd
);
48 void print_method(const isl_class
&clazz
, FunctionDecl
*method
,
49 vector
<string
> super
);
50 void print_method_overload(const isl_class
&clazz
,
51 FunctionDecl
*method
);
52 void print_method(const isl_class
&clazz
, const string
&fullname
,
53 const set
<FunctionDecl
*> &methods
, vector
<string
> super
);
54 void print_set_enum(const isl_class
&clazz
, FunctionDecl
*fd
,
55 int value
, const string
&name
, const vector
<string
> &super
);
56 void print_set_enum(const isl_class
&clazz
, FunctionDecl
*fd
,
57 const vector
<string
> &super
);