ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
python_converter.cpp File Reference
#include <set>
#include <python-frontend/string/char_utils.h>
#include <python-frontend/math/complex_handler.h>
#include <python-frontend/converter/converter_internal.h>
#include <python-frontend/math/convert_float_literal.h>
#include <python-frontend/function_call/builder.h>
#include <python-frontend/consteval/python_consteval.h>
#include <python-frontend/function_call/expr.h>
#include <python-frontend/json_utils.h>
#include <python-frontend/module/module_locator.h>
#include <python-frontend/param_annotations.h>
#include <python-frontend/python_annotation/python_annotation.h>
#include <python-frontend/class/python_class_builder.h>
#include <python-frontend/python_converter.h>
#include <python-frontend/python-dict/python_dict_handler.h>
#include <python-frontend/exception/python_exception_handler.h>
#include <python-frontend/lambda/python_lambda.h>
#include <python-frontend/python-list/python_list.h>
#include <python-frontend/type/python_typechecking.h>
#include <python-frontend/string/string_builder.h>
#include <python-frontend/symbol_id.h>
#include <python-frontend/tuple/tuple_handler.h>
#include <python-frontend/dynamic_type/dynamic_type_handler.h>
#include <python-frontend/type/type_utils.h>
#include <util/arith/arith_tools.h>
#include <util/expr/base_type.h>
#include <util/lang/c_typecast.h>
#include <util/lang/c_types.h>
#include <util/base/encoding.h>
#include <util/expr/expr_util.h>
#include <util/irep/irep.h>
#include <util/message/message.h>
#include <util/lang/python_types.h>
#include <util/irep/std_code.h>
#include <util/expr/string_constant.h>
#include <util/expr/symbolic_types.h>
#include <util/expr/type_byte_size.h>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstring>
#include <fstream>
#include <iomanip>
#include <limits>
#include <regex>
#include <stdexcept>
#include <sstream>
#include <unordered_map>
#include <unordered_set>
#include <boost/filesystem.hpp>

Functions

static void add_global_static_variable (contextt &ctx, const typet t, const std::string &name)
static std::string import_module_name (const nlohmann::json &node)
static void add_function_stub (nlohmann::json &stubs, const nlohmann::json &def, const std::string &name)
static nlohmann::json module_function (const nlohmann::json &body, const std::string &name)
 The function name defined directly in body, or an empty node.
static std::vector< std::string > classes_defining (const nlohmann::json &body, const std::string &only, const std::string &name, nlohmann::json &node)
 The classes in body defining a method name, restricted to only when that is non-empty.
static std::string receiver_named_parameter (const nlohmann::json &node)
 The receiver name node declares as a parameter, or an empty string.
static bool is_staticmethod (const nlohmann::json &node)
 Whether node carries the builtin @staticmethod decorator.

Function Documentation

◆ add_function_stub()

void add_function_stub ( nlohmann::json & stubs,
const nlohmann::json & def,
const std::string & name )
static

◆ add_global_static_variable()

void add_global_static_variable ( contextt & ctx,
const typet t,
const std::string & name )
static

◆ classes_defining()

std::vector< std::string > classes_defining ( const nlohmann::json & body,
const std::string & only,
const std::string & name,
nlohmann::json & node )
static

The classes in body defining a method name, restricted to only when that is non-empty.

node receives the last match found.

◆ import_module_name()

std::string import_module_name ( const nlohmann::json & node)
static

◆ is_staticmethod()

bool is_staticmethod ( const nlohmann::json & node)
static

Whether node carries the builtin @staticmethod decorator.

A dotted spelling names some other object, so only a bare Name counts.

◆ module_function()

nlohmann::json module_function ( const nlohmann::json & body,
const std::string & name )
static

The function name defined directly in body, or an empty node.

◆ receiver_named_parameter()

std::string receiver_named_parameter ( const nlohmann::json & node)
static

The receiver name node declares as a parameter, or an empty string.

The frontend binds self and cls to the enclosing class wherever they appear, so a static method spelling a parameter that way has no class to bind to.