ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
python_language.h
Go to the documentation of this file.
1#pragma once
2
5
6#include <nlohmann/json.hpp>
7
8#include <vector>
9
11{
12public:
14 static void register_bundled();
15
16 bool parse(const std::string &path) override;
17
18 bool final(contextt &context) override;
19
20 bool typecheck(contextt &context, const std::string &module) override;
21
22 bool from_expr(
23 const exprt &expr,
24 std::string &code,
25 const namespacet &ns,
26 unsigned flags) override;
27
28 bool from_type(
29 const typet &type,
30 std::string &code,
31 const namespacet &ns,
32 unsigned flags) override;
33
34 unsigned default_flags(presentationt target) const override;
35
36 std::string id() const override
37 {
38 return "python";
39 }
40
41 void show_parse(std::ostream &out) override;
42
43 languaget *new_language() const override
44 {
45 return new python_languaget;
46 }
47
51 const std::vector<nlohmann::json> &get_extra_asts() const
52 {
53 return extra_asts;
54 }
55
56private:
57 std::string ast_output_dir;
58 nlohmann::json ast;
59 std::vector<nlohmann::json> extra_asts;
60 global_scope global_scope_;
61};
62
Definition context.h:57
Definition expr.h:34
Definition global_scope.h:7
Definition language.h:16
Definition module.h:60
Definition namespace.h:10
Definition python_language.h:11
bool from_type(const typet &type, std::string &code, const namespacet &ns, unsigned flags) override
Definition python_language.cpp:391
void show_parse(std::ostream &out) override
Definition python_language.cpp:357
bool typecheck(contextt &context, const std::string &module) override
Definition python_language.cpp:257
std::string id() const override
Definition python_language.h:36
bool parse(const std::string &path) override
Definition python_language.cpp:140
languaget * new_language() const override
Definition python_language.h:43
const std::vector< nlohmann::json > & get_extra_asts() const
Additional positional Python files passed on the command line, beyond the first (github #6211).
Definition python_language.h:51
unsigned default_flags(presentationt target) const override
Definition python_language.cpp:401
static void register_bundled()
Registers the bundled parser scripts with file_operations.
Definition python_language.cpp:66
bool from_expr(const exprt &expr, std::string &code, const namespacet &ns, unsigned flags) override
Definition python_language.cpp:381
Definition type.h:9
presentationt
Definition language.h:10
Definition path.py:1
languaget * new_python_language()
Definition python_language.cpp:80