Go to the documentation of this file.
34 if(expr.
id() == ID_string_constant)
44 std::string result =
from_expr(ns,
id, expr);
48 exprt new_expr = expr;
62 xmlt value_xml{
"full_lhs_value"};
70 lhs_object.has_value() ? lhs_object->get_identifier() :
irep_idt();
73 const auto &bv_type = type_try_dynamic_cast<bitvector_typet>(value.
type());
74 const auto &constant = expr_try_dynamic_cast<constant_exprt>(value);
75 if(bv_type && constant)
77 const auto width = bv_type->get_width();
83 const auto binary_representation =
85 value_xml.set_attribute(
"binary", binary_representation);
95 dest=
xmlt(
"goto_trace");
99 for(
const auto &step : goto_trace.
steps)
105 xml_location=
xml(source_location);
120 if(!xml_location.
name.empty())
128 auto lhs_object = step.get_lhs_object();
130 lhs_object.has_value() ? lhs_object->get_identifier() :
irep_idt();
133 if(!xml_location.
name.empty())
140 lhs_object.has_value() &&
141 !ns.
lookup(lhs_object->get_identifier(), symbol))
143 std::string type_string =
156 std::string full_lhs_string;
158 if(step.full_lhs.is_not_nil())
170 step.assignment_type ==
180 printf_formatter(
id2string(step.format_string), step.io_args);
181 std::string text = printf_formatter.
as_string();
190 if(!xml_location.
name.empty())
193 for(
const auto &arg : step.io_args)
211 for(
const auto &arg : step.io_args)
218 if(!xml_location.
name.empty())
225 std::string tag =
"function_call";
239 if(!xml_location.
name.empty())
246 std::string tag =
"function_return";
260 if(!xml_location.
name.empty())
281 xmlt &xml_location_only =
298 previous_source_location=source_location;
optionalt< default_trace_stept > default_step(const goto_trace_stept &step, const source_locationt &previous_source_location)
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
optionalt< symbol_exprt > get_lhs_object() const
const irep_idt & display_name() const
Return language specific display name if present.
static bool is_printable_xml(const std::string &s)
Determine whether s does not contain any characters that cannot be escaped in XML 1....
void convert(const namespacet &ns, const goto_tracet &goto_trace, xmlt &dest)
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.
const string_constantt & to_string_constant(const exprt &expr)
Base class for all expressions.
irep_idt base_name
Base (non-scoped) name.
std::string from_type(const namespacet &ns, const irep_idt &identifier, const typet &type)
std::string to_string(const string_not_contains_constraintt &expr)
Used for debug printing.
Step of the trace of a GOTO program.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
typet & type()
Return the type of the expression.
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
irep_idt mode
Language mode.
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....
const std::string & id2string(const irep_idt &d)
xmlt xml(const irep_idt &property_id, const property_infot &property_info)
const irep_idt & id() const
array_exprt to_array_expr() const
convert string into array constant
void set_attribute(const std::string &attribute, unsigned value)
source_locationt location
Source code location of definition of symbol.
void set_attribute_bool(const std::string &attribute, bool value)
xmlt full_lhs_value(const goto_trace_stept &step, const namespacet &ns)
const irep_idt & get_file() const
const std::string integer2binary(const mp_integer &n, std::size_t width)
static void replace_string_constants_rec(exprt &expr)
Rewrite all string constants to their array counterparts.
std::string from_expr(const namespacet &ns, const irep_idt &identifier, const exprt &expr)
irep_idt name
The unique identifier.
xmlt & new_element(const std::string &key)