File: python.h

package info (click to toggle)
llvm-toolchain-9 1%3A9.0.1-16
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 882,436 kB
  • sloc: cpp: 4,167,636; ansic: 714,256; asm: 457,610; python: 155,927; objc: 65,094; sh: 42,856; lisp: 26,908; perl: 7,786; pascal: 7,722; makefile: 6,881; ml: 5,581; awk: 3,648; cs: 2,027; xml: 888; javascript: 381; ruby: 156
file content (46 lines) | stat: -rw-r--r-- 1,656 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <set>
#include <clang/AST/Decl.h>
#include "generator.h"

using namespace std;
using namespace clang;

class python_generator : public generator {
private:
	set<string> done;

public:
	python_generator(SourceManager &SM, set<RecordDecl *> &exported_types,
		set<FunctionDecl *> exported_functions,
		set<FunctionDecl *> functions) :
		generator(SM, exported_types, exported_functions, functions) {}

	virtual void generate();

private:
	void print(const isl_class &clazz);
	void print_method_header(bool is_static, const string &name, int n_arg);
	void print_class_header(const isl_class &clazz, const string &name,
		const vector<string> &super);
	void print_type_check(const string &type, int pos, bool upcast,
		const string &super, const string &name, int n);
	void print_copy(QualType type);
	void print_callback(ParmVarDecl *param, int arg);
	void print_arg_in_call(FunctionDecl *fd, int arg, int skip);
	void print_argtypes(FunctionDecl *fd);
	void print_method_return(FunctionDecl *method);
	void print_restype(FunctionDecl *fd);
	void print(map<string, isl_class> &classes, set<string> &done);
	void print_constructor(const isl_class &clazz, FunctionDecl *method);
	void print_representation(const isl_class &clazz,
		const string &python_name);
	void print_method_type(FunctionDecl *fd);
	void print_method_types(const isl_class &clazz);
	void print_method(const isl_class &clazz, FunctionDecl *method,
		vector<string> super);
	void print_method_overload(const isl_class &clazz,
		FunctionDecl *method);
	void print_method(const isl_class &clazz, const string &fullname,
		const set<FunctionDecl *> &methods, vector<string> super);

};