5#include <nlohmann/json.hpp>
34 const nlohmann::json &json_node = nlohmann::json());
54 const nlohmann::json &left = nlohmann::json(),
55 const nlohmann::json &right = nlohmann::json());
66 const nlohmann::json &left);
76 const std::string &fn_name,
77 const typet &arg_type,
Main converter for transforming Python AST into ESBMC's intermediate representation.
Definition python_converter.h:76
exprt build_string_literal(const std::string &str)
Create a null-terminated string from a std::string.
Definition string_builder.cpp:190
exprt build_null_terminated_string(const std::vector< exprt > &chars)
Create a null-terminated string array from a vector of character expressions.
Definition string_builder.cpp:167
std::vector< exprt > extract_string_chars(const exprt &expr, const nlohmann::json &json_node=nlohmann::json())
Extract characters from an expression, stopping at null terminator Returns a vector of character expr...
Definition string_builder.cpp:44
exprt build_byte_string(const std::vector< uint8_t > &bytes)
Create a null-terminated string from a vector of bytes.
Definition string_builder.cpp:200
exprt ensure_null_terminated_string(exprt &e)
Ensure an expression is a null-terminated string Converts single characters or promotes to proper str...
Definition string_builder.cpp:210
exprt handle_string_repetition(exprt &lhs, exprt &rhs)
Definition string_builder.cpp:314
exprt make_char_constant(unsigned char ch)
Create a character constant from a byte value.
Definition string_builder.cpp:37
exprt concatenate_strings(const exprt &lhs, const exprt &rhs, const nlohmann::json &left=nlohmann::json(), const nlohmann::json &right=nlohmann::json())
Concatenate two string expressions with proper null-termination.
Definition string_builder.cpp:233
exprt build_raw_byte_array(const std::vector< uint8_t > &bytes)
Create a raw byte array without null termination (for Python bytes literals).
Definition string_builder.cpp:488
string_builder(python_converter &converter, string_handler *handler)
Definition string_builder.cpp:15
exprt build_runtime_str_conversion_call(const std::string &fn_name, const typet &arg_type, const exprt &arg)
Build a side-effect call to a char *fn(arg_type) operational model.
Definition string_builder.cpp:569
exprt make_null_terminator()
Create a null terminator character constant.
Definition string_builder.cpp:30
exprt build_runtime_str_join_call(const exprt &separator, const exprt &list_expr)
Build a side-effect call to the runtime __python_str_join operational model.
Definition string_builder.cpp:600
exprt concatenate_strings_via_c_function(const exprt &lhs, const exprt &rhs, const nlohmann::json &left)
Definition string_builder.cpp:513
Handles all string-related operations for Python-to-C conversion.
Definition string_handler.h:36
Definition type_handler.h:113