Go to the documentation of this file.
83 if(has_this && it==arguments.begin())
106 unsigned &precedence)
110 if(full_type.
id()!=ID_struct)
115 std::string dest=
"{ ";
120 assert(components.size()==src.
operands().size());
122 exprt::operandst::const_iterator o_it=src.
operands().begin();
127 for(
const auto &c : components)
129 if(c.type().id() != ID_code)
131 std::string tmp=
convert(*o_it);
138 if(last_size+40<dest.size())
141 last_size=dest.size();
149 irep_idt field_name = c.get_pretty_name();
150 if(field_name.
empty())
151 field_name = c.get_name();
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);
248 const std::string d = declarator.empty() ? declarator : (
" " + declarator);
268 return q+
"boolean"+d;
271 else if(src.
id()==ID_code)
284 for(java_method_typet::parameterst::const_iterator it = parameters.begin();
285 it != parameters.end();
288 if(it!=parameters.begin())
296 if(!parameters.empty())
304 dest+=
" -> "+
convert(return_type);
321 return convert(instanceof_expr.tested_expr()) +
" instanceof " +
322 convert(instanceof_expr.target_type());
334 if(src.
get(ID_statement)==ID_java_new_array ||
335 src.
get(ID_statement)==ID_java_new_array_data)
339 std::string tmp_size=
358 std::string dest=
indent_str(indent)+
"delete ";
375 unsigned &precedence)
377 if(src.
id()==
"java-this")
382 if(src.
id()==ID_java_instanceof)
387 else if(src.
id()==ID_side_effect &&
388 (src.
get(ID_statement)==ID_java_new ||
389 src.
get(ID_statement)==ID_java_new_array ||
390 src.
get(ID_statement)==ID_java_new_array_data))
395 else if(src.
id()==ID_side_effect &&
396 src.
get(ID_statement)==ID_throw)
401 else if(src.
id()==ID_code &&
402 to_code(src).get_statement()==ID_exception_landingpad)
404 const exprt &catch_expr=
406 return "catch_landingpad("+
412 else if(src.
id()==ID_unassigned)
414 else if(src.
id()==
"pod_constructor")
415 return "pod_constructor";
416 else if(src.
id()==ID_virtual_function)
424 const auto &literal = expr_try_dynamic_cast<java_string_literal_exprt>(src))
428 else if(src.
id()==ID_constant)
440 if(statement==ID_java_new ||
441 statement==ID_java_new_array)
444 if(statement==ID_function_call)
std::string MetaString(const std::string &in)
const componentst & components() const
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
bool has_ellipsis() const
const unary_exprt & to_unary_expr(const exprt &expr)
Cast an exprt to a unary_exprt.
const code_function_callt & to_code_function_call(const goto_instruction_codet &code)
std::string convert_java_new(const exprt &src)
const irep_idt & mangled_method_name() const
The method name after mangling it by combining it with the descriptor.
std::string convert_java_this()
const struct_typet & to_struct_type(const typet &type)
Cast a typet to a struct_typet.
The type of an expression, extends irept.
signedbv_typet java_long_type()
const irept & find(const irep_idt &name) const
virtual std::string convert(const typet &src) override
virtual std::string convert_constant(const constant_exprt &src, unsigned &precedence)
float to_float() const
Note that calling from_float -> to_float can return different bit patterns for NaN.
std::vector< parametert > parameterst
Base class for all expressions.
std::vector< componentt > componentst
std::string convert_code(const codet &src)
bool is_true() const
Return whether the expression is a constant representing true.
virtual void read(const typet &src)=0
std::string convert_java_instanceof(const exprt &src)
bool is_false() const
Return whether the expression is a constant representing false.
const irep_idt & get(const irep_idt &name) const
An expression describing a method on a class.
virtual std::string convert_with_precedence(const exprt &src, unsigned &precedence) override
double to_double() const
Note that calling from_double -> to_double can return different bit patterns for NaN.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
const codet & to_code(const exprt &expr)
typet & type()
Return the type of the expression.
goto_instruction_codet representation of a function call statement.
virtual std::string convert(const typet &src)
const std::string & id2string(const irep_idt &d)
static std::string indent_str(unsigned indent)
virtual std::unique_ptr< qualifierst > clone() const =0
std::string convert_code_function_call(const code_function_callt &src, unsigned indent)
const pointer_typet & to_pointer_type(const typet &type)
Cast a typet to a pointer_typet.
virtual std::string convert_rec(const typet &src, const qualifierst &qualifiers, const std::string &declarator) override
const irep_idt & id() const
std::vector< exprt > operandst
std::string convert_code_java_delete(const exprt &src, unsigned precedence)
signedbv_typet java_int_type()
std::string floating_point_to_java_string(float_type value)
Convert floating point number to a string without printing unnecessary zeros.
const parameterst & parameters() const
signedbv_typet java_short_type()
const exprt & catch_expr() const
virtual std::string convert_constant(const constant_exprt &src, unsigned &precedence) override
virtual std::string convert_struct(const exprt &src, unsigned &precedence) override
signedbv_typet java_byte_type()
std::string convert_norep(const exprt &src, unsigned &precedence)
bool is_zero() const
Return whether the expression is a constant representing 0.
static code_landingpadt & to_code_landingpad(codet &code)
Structure type, corresponds to C style structs.
floatbv_typet java_double_type()
const typet & follow(const typet &) const
Resolve type symbol to the type it points to.
const class_method_descriptor_exprt & to_class_method_descriptor_expr(const exprt &expr)
Cast an exprt to a class_method_descriptor_exprt.
const java_instanceof_exprt & to_java_instanceof_expr(const exprt &expr)
Cast an exprt to a java_instanceof_exprt.
virtual std::string convert_code(const codet &src, unsigned indent) override
unsignedbv_typet java_char_type()
const typet & base_type() const
The type of the data what we point to.
std::string type2java(const typet &type, const namespacet &ns)
std::string expr2java(const exprt &expr, const namespacet &ns)
const irep_idt & class_id() const
Unique identifier in the symbol table, of the compile time type of the class which this expression is...
c_bool_typet java_boolean_type()
const typet & return_type() const
#define forall_expr(it, expr)
virtual std::string convert_rec(const typet &src, const qualifierst &qualifiers, const std::string &declarator)
const java_method_typet & to_java_method_type(const typet &type)
static void utf16_native_endian_to_java(const wchar_t ch, std::ostringstream &result, const std::locale &loc)
Escapes non-printable characters, whitespace except for spaces, double- and single-quotes and backsla...
virtual std::string as_string() const =0
A constant literal expression.
virtual std::string convert_with_precedence(const exprt &src, unsigned &precedence)
const std::size_t char_representation_length
optionalt< std::string > convert_function(const exprt &src)
Returns a string if src is a function with a known conversion, else returns nullopt.
floatbv_typet java_float_type()
std::string convert_code_java_new(const exprt &src, unsigned precedence)
Data structure for representing an arbitrary statement in a program.
const constant_exprt & to_constant_expr(const exprt &expr)
Cast an exprt to a constant_exprt.
const std::string integer2string(const mp_integer &n, unsigned base)