22 if(expr_type.
id() == ID_string)
28 else if(expr_type.
id()==ID_range)
36 for(std::size_t i=0; i<width; i++)
45 expr_type.
id() == ID_unsignedbv || expr_type.
id() == ID_signedbv ||
46 expr_type.
id() == ID_bv || expr_type.
id() == ID_fixedbv ||
47 expr_type.
id() == ID_floatbv || expr_type.
id() == ID_c_enum ||
48 expr_type.
id() == ID_c_enum_tag || expr_type.
id() == ID_c_bool ||
49 expr_type.
id() == ID_c_bit_field)
53 for(std::size_t i=0; i<width; i++)
61 else if(expr_type.
id()==ID_enumeration)
66 for(std::size_t i=0; i<elements.size(); i++)
67 if(elements[i].
id()==value)
70 else if(expr_type.
id()==ID_verilog_signedbv ||
71 expr_type.
id()==ID_verilog_unsignedbv)
76 binary.size() * 2 == width,
77 "wrong value length in constant",
80 for(std::size_t i=0; i<
binary.size(); i++)
110 "unknown character in Verilog constant",
virtual bvt convert_constant(const constant_exprt &expr)
numberingt< irep_idt > string_numbering
bvt conversion_failed(const exprt &expr)
Print that the expression of x has failed conversion, then return a vector of x's width.
virtual std::size_t boolbv_width(const typet &type) const
static bvt build_constant(const mp_integer &i, std::size_t width)
A constant literal expression.
const irep_idt & get_value() const
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
const irept::subt & elements() const
typet & type()
Return the type of the expression.
const irep_idt & id() const
number_type number(const key_type &a)
mp_integer get_from() const
The type of an expression, extends irept.
const std::string & id2string(const irep_idt &d)
static std::string binary(const constant_exprt &src)
std::vector< literalt > bvt
literalt const_literal(bool value)
const mp_integer string2integer(const std::string &n, unsigned base)
const std::string integer2binary(const mp_integer &n, std::size_t width)
#define DATA_INVARIANT_WITH_DIAGNOSTICS(CONDITION, REASON,...)
const range_typet & to_range_type(const typet &type)
Cast a typet to a range_typet.
const enumeration_typet & to_enumeration_type(const typet &type)
Cast a typet to a enumeration_typet.