ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
string_handler.cpp File Reference
#include <python-frontend/string/char_utils.h>
#include <python-frontend/exception/exception_utils.h>
#include <python-frontend/json_utils.h>
#include <python-frontend/math/python_int_overflow.h>
#include <python-frontend/python-list/python_list.h>
#include <util/base/host_rounding_mode.h>
#include <python-frontend/string/string_method_dispatch.h>
#include <python-frontend/string/string_handler.h>
#include <algorithm>
#include <charconv>
#include <optional>
#include <python-frontend/string/string_handler_utils.h>
#include <python-frontend/python_converter.h>
#include <python-frontend/exception/python_exception_handler.h>
#include <python-frontend/function_call/expr.h>
#include <python-frontend/python_expr_builder.h>
#include <python-frontend/string/string_builder.h>
#include <python-frontend/tuple/tuple_handler.h>
#include <python-frontend/type/type_utils.h>
#include <python-frontend/symbol_id.h>
#include <irep2/irep2_utils.h>
#include <util/arith/arith_tools.h>
#include <util/lang/c_types.h>
#include <util/expr/expr_util.h>
#include <util/arith/ieee_float.h>
#include <util/irep/migrate.h>
#include <util/lang/python_types.h>
#include <util/irep/std_expr.h>
#include <util/irep/std_code.h>
#include <util/expr/string_constant.h>
#include <util/symtab/symbol.h>
#include <util/irep/type.h>
#include <boost/algorithm/string/predicate.hpp>
#include <array>
#include <cmath>
#include <cctype>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <limits>
#include <set>
#include <functional>
#include <stdexcept>
#include <unordered_map>
#include <unordered_set>
#include <vector>
Include dependency graph for string_handler.cpp:

Functions

static bool try_const_string_from_single_assignment (const std::string &var_name, const nlohmann::json &func_scope, std::string &out)
static bool parse_format_padding (const std::string &format, char &fill, char &align, int &width, bool &zero_pad, std::string &rest)
static std::string apply_padding (const std::string &input, char fill, char align, int width)
static std::optional< long long > fixed_point_precision (const std::string &format)
static bool fold_constant_string (const nlohmann::json &node, python_converter &converter, std::string &out, unsigned depth)
static bool python_str_replace (const std::string &subject, const std::string &old_sub, const std::string &new_sub, long long count, std::string &out)
static bool resolve_join_iterable (const nlohmann::json &arg, python_converter &converter, nlohmann::json &seq)
static bool is_name_binop_or_split_call (const nlohmann::json &arg)
static bool fold_string_method_call (const nlohmann::json &node, python_converter &converter, std::string &out, unsigned depth)
static bool names_imported_module (const python_converter &converter, const nlohmann::json &receiver, const nlohmann::json &use)
 Whether receiver is a Name for a module the program imported, and no binding in scope at the call use shadows it.

Function Documentation

◆ apply_padding()

std::string apply_padding ( const std::string & input,
char fill,
char align,
int width )
static

◆ fixed_point_precision()

std::optional< long long > fixed_point_precision ( const std::string & format)
static

◆ fold_constant_string()

bool fold_constant_string ( const nlohmann::json & node,
python_converter & converter,
std::string & out,
unsigned depth )
static

◆ fold_string_method_call()

bool fold_string_method_call ( const nlohmann::json & node,
python_converter & converter,
std::string & out,
unsigned depth )
static

◆ is_name_binop_or_split_call()

bool is_name_binop_or_split_call ( const nlohmann::json & arg)
static

◆ names_imported_module()

bool names_imported_module ( const python_converter & converter,
const nlohmann::json & receiver,
const nlohmann::json & use )
static

Whether receiver is a Name for a module the program imported, and no binding in scope at the call use shadows it.

◆ parse_format_padding()

bool parse_format_padding ( const std::string & format,
char & fill,
char & align,
int & width,
bool & zero_pad,
std::string & rest )
static

◆ python_str_replace()

bool python_str_replace ( const std::string & subject,
const std::string & old_sub,
const std::string & new_sub,
long long count,
std::string & out )
static

◆ resolve_join_iterable()

bool resolve_join_iterable ( const nlohmann::json & arg,
python_converter & converter,
nlohmann::json & seq )
static

◆ try_const_string_from_single_assignment()

bool try_const_string_from_single_assignment ( const std::string & var_name,
const nlohmann::json & func_scope,
std::string & out )
static