ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
python_class_builder.h
Go to the documentation of this file.
1#pragma once
2
3#include <nlohmann/json.hpp>
5
7class codet;
8class symbolt;
9class struct_typet;
10
11class symbol_id;
12
14{
15public:
16 python_class_builder(python_converter &conv, const nlohmann::json &cls_node)
17 : conv_(conv), cls_(cls_node)
18 {
19 pc_.parse(cls_);
20 }
21
22 void build(codet &out);
23
24private:
25 python_converter &conv_;
26 const nlohmann::json &cls_;
27 python_class pc_;
28
29 // helpers
30 static std::string leaf(const std::string &dotted);
31
32 symbolt *ensure_sym(const std::string &name);
33
34 bool is_unmodelled_base(const std::string &base) const;
35
36 bool get_bases(struct_typet &st);
37
41 bool register_method(struct_typet &st, const symbol_id &sid);
42
43 void get_members(struct_typet &st, codet &out, bool has_ud_base);
44
45 void add_self_attrs(struct_typet &st);
46
47 void gen_ctor(bool has_ud_base, struct_typet &st);
48
50 bool is_typeddict_class() const;
51};
static const twodig_t base
Definition bigint.cpp:28
Definition std_code.h:8
python_class_builder(python_converter &conv, const nlohmann::json &cls_node)
Definition python_class_builder.h:16
void build(codet &out)
Definition python_class_builder.cpp:375
Definition python_class.h:10
Main converter for transforming Python AST into ESBMC's intermediate representation.
Definition python_converter.h:76
Definition std_types.h:232
Definition symbol_id.h:6
Definition symbol.h:12