-
Notifications
You must be signed in to change notification settings - Fork 114
Expand file tree
/
Copy pathpythonparser.h
More file actions
44 lines (37 loc) · 1002 Bytes
/
pythonparser.h
File metadata and controls
44 lines (37 loc) · 1002 Bytes
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
#ifndef CC_PARSER_PYTHONPARSER_H
#define CC_PARSER_PYTHONPARSER_H
#include <string>
#include <vector>
#include <map>
#include <parser/abstractparser.h>
#include <parser/parsercontext.h>
#include <parser/sourcemanager.h>
#include <util/parserutil.h>
#include <boost/python.hpp>
#include <model/pyname.h>
#include <model/pyname-odb.hxx>
namespace cc
{
namespace parser
{
namespace python = boost::python;
typedef std::unordered_map<std::uint64_t, model::PYName> PYNameMap;
class PythonParser : public AbstractParser
{
public:
PythonParser(ParserContext& ctx_);
virtual ~PythonParser();
virtual bool parse() override;
virtual bool cleanupDatabase() override;
private:
struct ParseResultStats {
std::uint32_t partial;
std::uint32_t full;
};
python::object m_py_module;
void processFile(const python::object& obj, PYNameMap& map, ParseResultStats& parse_result);
void parseProject(const std::string& root_path);
};
} // parser
} // cc
#endif // CC_PARSER_PYTHONPARSER_H