35 if(expr.
id() == ID_string_constant)
45 std::string result =
from_expr(ns,
id, expr);
49 exprt new_expr = expr;
63 xmlt value_xml{
"full_lhs_value"};
71 lhs_object.has_value() ? lhs_object->get_identifier() :
irep_idt();
74 const auto &bv_type = type_try_dynamic_cast<bitvector_typet>(value.
type());
75 const auto &constant = expr_try_dynamic_cast<constant_exprt>(value);
76 if(bv_type && constant)
78 const auto width = bv_type->get_width();
84 const auto binary_representation =
86 value_xml.set_attribute(
"binary", binary_representation);
96 dest=
xmlt(
"goto_trace");
100 for(
const auto &step : goto_trace.
steps)
106 xml_location=
xml(source_location);
121 if(!xml_location.
name.empty())
129 auto lhs_object = step.get_lhs_object();
131 lhs_object.has_value() ? lhs_object->get_identifier() :
irep_idt();
134 if(!xml_location.
name.empty())
141 lhs_object.has_value() &&
142 !ns.
lookup(lhs_object->get_identifier(), symbol))
144 std::string type_string =
157 std::string full_lhs_string;
159 if(step.full_lhs.is_not_nil())
171 step.assignment_type ==
181 printf_formatter(
id2string(step.format_string), step.io_args);
182 std::string text = printf_formatter.
as_string();
191 if(!xml_location.
name.empty())
194 for(
const auto &arg : step.io_args)
212 for(
const auto &arg : step.io_args)
219 if(!xml_location.
name.empty())
226 std::string tag =
"function_call";
240 if(!xml_location.
name.empty())
247 std::string tag =
"function_return";
261 if(!xml_location.
name.empty())
282 xmlt &xml_location_only =
299 previous_source_location=source_location;
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
typet & type()
Return the type of the expression.
Step of the trace of a GOTO program.
std::optional< symbol_exprt > get_lhs_object() const
const irep_idt & id() const
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
const irep_idt & get_file() const
array_exprt to_array_expr() const
convert string into array constant
irep_idt base_name
Base (non-scoped) name.
const irep_idt & display_name() const
Return language specific display name if present.
source_locationt location
Source code location of definition of symbol.
irep_idt name
The unique identifier.
irep_idt mode
Language mode.
void set_attribute_bool(const std::string &attribute, bool value)
void set_attribute(const std::string &attribute, unsigned value)
xmlt & new_element(const std::string &key)
static bool is_printable_xml(const std::string &s)
Determine whether s does not contain any characters that cannot be escaped in XML 1....
const std::string & id2string(const irep_idt &d)
std::string from_expr(const namespacet &ns, const irep_idt &identifier, const exprt &expr)
std::string from_type(const namespacet &ns, const irep_idt &identifier, const typet &type)
const std::string integer2binary(const mp_integer &n, std::size_t width)
xmlt xml(const irep_idt &property_id, const property_infot &property_info)
const string_constantt & to_string_constant(const exprt &expr)
std::string to_string(const string_not_contains_constraintt &expr)
Used for debug printing.
std::string default_step_name(const default_step_kindt &step_type)
Turns a default_step_kindt into a string that can be used in the trace.
std::optional< default_trace_stept > default_step(const goto_trace_stept &step, const source_locationt &previous_source_location)
Utilities for printing location info steps in the trace in a format agnostic way.
xmlt full_lhs_value(const goto_trace_stept &step, const namespacet &ns)
static std::string get_printable_xml(const namespacet &ns, const irep_idt &id, const exprt &expr)
Given an expression expr, produce a string representation that is printable in XML 1....
static void replace_string_constants_rec(exprt &expr)
Rewrite all string constants to their array counterparts.
void convert(const namespacet &ns, const goto_tracet &goto_trace, xmlt &dest)