22 if(expr.
type().
id()==ID_natural ||
23 expr.
type().
id()==ID_integer ||
24 expr.
type().
id()==ID_unsignedbv ||
25 expr.
type().
id()==ID_signedbv)
29 return "(number conversion failed)";
33 else if(expr.
type().
id()==ID_fixedbv)
37 else if(expr.
type().
id()==ID_floatbv)
42 else if(expr.
id()==ID_string_constant)
45 return "(format-constant failed: "+expr.
id_string()+
")";
Base class for all expressions.
typet & type()
Return the type of the expression.
bool is_constant() const
Return whether the expression is a constant.
std::string format(const format_spect &format_spec) const
std::string format(const format_spect &format_spec) const
const std::string & id_string() const
const irep_idt & id() const
const std::string & id2string(const irep_idt &d)
const std::string integer2string(const mp_integer &n, unsigned base)
API to expression classes.
const constant_exprt & to_constant_expr(const exprt &expr)
Cast an exprt to a constant_exprt.
const string_constantt & to_string_constant(const exprt &expr)