40 result[
"bytecode_index"]=
50 if(type.
id()==ID_symbol)
55 if(type.
id()==ID_unsignedbv)
61 else if(type.
id()==ID_signedbv)
67 else if(type.
id()==ID_floatbv)
73 else if(type.
id()==ID_bv)
78 else if(type.
id()==ID_c_bit_field)
84 else if(type.
id()==ID_c_enum_tag)
89 else if(type.
id()==ID_fixedbv)
95 else if(type.
id()==ID_pointer)
100 else if(type.
id()==ID_bool)
104 else if(type.
id()==ID_array)
109 else if(type.
id()==ID_vector)
115 else if(type.
id()==ID_struct)
121 for(
const auto &component : components)
125 e[
"type"]=
json(component.type(), ns);
128 else if(type.
id()==ID_union)
134 for(
const auto &component : components)
138 e[
"type"]=
json(component.type(), ns);
155 if(expr.
id()==ID_constant)
157 if(type.
id()==ID_unsignedbv ||
158 type.
id()==ID_signedbv ||
159 type.
id()==ID_c_bit_field)
167 const typet &underlying_type=
168 type.
id()==ID_c_bit_field?type.
subtype():
173 std::string sig=is_signed?
"":
"unsigned ";
190 else if(type.
id()==ID_c_enum)
201 else if(type.
id()==ID_c_enum_tag)
206 return json(tmp, ns);
208 else if(type.
id()==ID_bv)
213 else if(type.
id()==ID_fixedbv)
221 else if(type.
id()==ID_floatbv)
229 else if(type.
id()==ID_pointer)
233 if(expr.
get(ID_value)==ID_NULL)
236 else if(type.
id()==ID_bool)
242 else if(type.
id()==ID_c_bool)
256 else if(expr.
id()==ID_array)
267 e[
"value"]=
json(*it, ns);
271 else if(expr.
id()==ID_struct)
276 if(type.
id()==ID_struct)
280 assert(components.size()==expr.
operands().size());
283 for(
unsigned m=0; m<expr.
operands().size(); m++)
291 else if(expr.
id()==ID_union)
298 e[
"value"]=
json(expr.
op0(), ns);
The type of an expression.
bool is_signed(const typet &t)
Convenience function – is the type signed?
const typet & follow(const typet &src) const
struct configt::ansi_ct ansi_c
const std::string & id2string(const irep_idt &d)
const std::string integer2string(const mp_integer &n, unsigned base)
const union_typet & to_union_type(const typet &type)
Cast a generic typet to a union_typet.
const irep_idt & get_function() const
std::vector< componentt > componentst
const componentst & components() const
static jsont json_boolean(bool value)
A constant literal expression.
const floatbv_typet & to_floatbv_type(const typet &type)
Cast a generic typet to a floatbv_typet.
json_arrayt & make_array()
const irep_idt & get_column() const
const typet & follow_tag(const union_tag_typet &src) const
jsont & push_back(const jsont &json)
const irep_idt & id() const
void set_value(const irep_idt &value)
const irep_idt & get_line() const
const c_enum_tag_typet & to_c_enum_tag_type(const typet &type)
Cast a generic typet to a c_enum_tag_typet.
unsigned long_long_int_width
API to expression classes.
const irep_idt & get(const irep_namet &name) const
#define forall_operands(it, expr)
const union_exprt & to_union_expr(const exprt &expr)
Cast a generic exprt to a union_exprt.
const c_bit_field_typet & to_c_bit_field_type(const typet &type)
Cast a generic typet to a c_bit_field_typet.
const unsignedbv_typet & to_unsignedbv_type(const typet &type)
Cast a generic typet to an unsignedbv_typet.
std::size_t get_width() const
const struct_typet & to_struct_type(const typet &type)
Cast a generic typet to a struct_typet.
const bv_typet & to_bv_type(const typet &type)
Cast a generic typet to a bv_typet.
const irep_idt & get_file() const
const fixedbv_typet & to_fixedbv_type(const typet &type)
Cast a generic typet to a fixedbv_typet.
Base class for all expressions.
const signedbv_typet & to_signedbv_type(const typet &type)
Cast a generic typet to a signedbv_typet.
const std::string & get_string(const irep_namet &name) const
const irep_idt & get_java_bytecode_index() const
json_objectt & make_object()
const constant_exprt & to_constant_expr(const exprt &expr)
Cast a generic exprt to a constant_exprt.
const typet & subtype() const
const vector_typet & to_vector_type(const typet &type)
Cast a generic typet to a vector_typet.
json_objectt json(const source_locationt &location)
const bitvector_typet & to_bitvector_type(const typet &type)
Cast a generic typet to a bitvector_typet.