86 if(has_this && it==arguments.begin())
109 unsigned &precedence)
113 if(full_type.
id()!=ID_struct)
118 std::string dest=
"{ ";
123 assert(components.size()==src.
operands().size());
125 exprt::operandst::const_iterator o_it=src.
operands().begin();
130 for(
const auto &c : components)
132 if(c.type().id() != ID_code)
134 std::string tmp=
convert(*o_it);
141 if(last_size+40<dest.size())
144 last_size=dest.size();
167 unsigned &precedence)
169 if(src.
type().
id()==ID_c_bool)
176 else if(src.
type().
id()==ID_bool)
183 else if(src.
type().
id()==ID_pointer)
194 const char16_t int_value = numeric_cast_v<char16_t>(src);
204 const mp_integer int_value = numeric_cast_v<mp_integer>(src);
205 std::string dest=
"(byte)";
212 const mp_integer int_value = numeric_cast_v<mp_integer>(src);
213 std::string dest=
"(short)";
220 const mp_integer int_value = numeric_cast_v<mp_integer>(src);
242 const std::string &declarator)
244 std::unique_ptr<qualifierst> clone = qualifiers.
clone();
246 new_qualifiers.
read(src);
249 declarator==
""?declarator:(
" "+declarator);
269 return q+
"boolean"+d;
272 else if(src.
id()==ID_code)
285 for(java_method_typet::parameterst::const_iterator it = parameters.begin();
286 it != parameters.end();
289 if(it!=parameters.begin())
297 if(!parameters.empty())
305 dest+=
" -> "+
convert(return_type);
339 if(src.
get(ID_statement)==ID_java_new_array ||
340 src.
get(ID_statement)==ID_java_new_array_data)
344 std::string tmp_size=
345 convert(static_cast<const exprt &>(src.
find(ID_size)));
363 std::string dest=
indent_str(indent)+
"delete ";
380 unsigned &precedence)
382 if(src.
id()==
"java-this")
384 if(src.
id()==ID_java_instanceof)
386 else if(src.
id()==ID_side_effect &&
387 (src.
get(ID_statement)==ID_java_new ||
388 src.
get(ID_statement)==ID_java_new_array ||
389 src.
get(ID_statement)==ID_java_new_array_data))
391 else if(src.
id()==ID_side_effect &&
392 src.
get(ID_statement)==ID_throw)
394 else if(src.
id()==ID_code &&
397 const exprt &catch_expr=
399 return "catch_landingpad("+
405 else if(src.
id()==ID_unassigned)
407 else if(src.
id()==
"pod_constructor")
408 return "pod_constructor";
409 else if(src.
id()==ID_virtual_function)
411 return "VIRTUAL_FUNCTION(" +
417 else if(src.
id()==ID_java_string_literal)
419 else if(src.
id()==ID_constant)
431 if(statement==ID_java_new ||
432 statement==ID_java_new_array)
435 if(statement==ID_function_call)
Java-specific type qualifiers.
const irep_idt & get_statement() const
virtual std::string convert_with_precedence(const exprt &src, unsigned &precedence) override
The type of an expression, extends irept.
virtual std::string convert_struct(const exprt &src, unsigned &precedence) override
std::string type2java(const typet &type, const namespacet &ns)
virtual std::string convert_rec(const typet &src, const qualifierst &qualifiers, const std::string &declarator)
std::string convert_java_new(const exprt &src, unsigned precedence)
const std::string & id2string(const irep_idt &d)
std::vector< parametert > parameterst
const std::string integer2string(const mp_integer &n, unsigned base)
std::string convert_function(const exprt &src, const std::string &symbol, unsigned precedence)
typet java_boolean_type()
virtual void read(const typet &src)=0
bool has_ellipsis() const
std::string convert_code_java_delete(const exprt &src, unsigned precedence)
std::string convert_java_instanceof(const exprt &src, unsigned precedence)
#define forall_expr(it, expr)
std::vector< componentt > componentst
virtual std::string convert_constant(const constant_exprt &src, unsigned &precedence) override
bool is_false() const
Return whether the expression is a constant representing false.
const componentst & components() const
virtual std::string convert_code(const codet &src, unsigned indent) override
std::string convert_code(const codet &src)
virtual std::string convert_rec(const typet &src, const qualifierst &qualifiers, const std::string &declarator) override
bool is_true() const
Return whether the expression is a constant representing true.
typet & type()
Return the type of the expression.
A constant literal expression.
Structure type, corresponds to C style structs.
std::string floating_point_to_java_string(float_type value)
Convert floating point number to a string without printing unnecessary zeros.
virtual std::string convert(const typet &src)
virtual std::string convert_constant(const constant_exprt &src, unsigned &precedence)
const irep_idt & id() const
static void utf16_native_endian_to_java(const wchar_t ch, std::ostringstream &result, const std::locale &loc)
virtual std::unique_ptr< qualifierst > clone() const =0
API to expression classes.
double to_double() const
Note that calling from_double -> to_double can return different bit patterns for NaN.
const irep_idt & get(const irep_namet &name) const
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
codet representation of a function call statement.
const std::size_t char_representation_length
const typet & follow(const typet &) const
Resolve type symbol to the type it points to.
const struct_typet & to_struct_type(const typet &type)
Cast a typet to a struct_typet.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
const constant_exprt & to_constant_expr(const exprt &expr)
Cast an exprt to a constant_exprt.
std::vector< exprt > operandst
std::string convert_norep(const exprt &src, unsigned &precedence)
virtual std::string convert(const typet &src) override
const java_method_typet & to_java_method_type(const typet &type)
static code_landingpadt & to_code_landingpad(codet &code)
virtual std::string as_string() const =0
Base class for all expressions.
const parameterst & parameters() const
virtual std::string convert_with_precedence(const exprt &src, unsigned &precedence)
const std::string & get_string(const irep_namet &name) const
bool is_zero() const
Return whether the expression is a constant representing 0.
const codet & to_code(const exprt &expr)
const exprt & catch_expr() const
std::string MetaString(const std::string &in)
std::string convert_code_function_call(const code_function_callt &src, unsigned indent)
Data structure for representing an arbitrary statement in a program.
const typet & subtype() const
std::string convert_java_this(const exprt &src, unsigned precedence)
const irept & find(const irep_namet &name) const
float to_float() const
Note that calling from_float -> to_float can return different bit patterns for NaN.
const typet & return_type() const
static std::string indent_str(unsigned indent)
std::string expr2java(const exprt &expr, const namespacet &ns)
const code_function_callt & to_code_function_call(const codet &code)