cprover
|
#include <expr2c_class.h>
Public Member Functions | |
expr2ct (const namespacet &_ns, const expr2c_configurationt &configuration=expr2c_configurationt::default_configuration) | |
virtual | ~expr2ct () |
virtual std::string | convert (const typet &src) |
virtual std::string | convert (const exprt &src) |
void | get_shorthands (const exprt &expr) |
std::string | convert_with_identifier (const typet &src, const std::string &identifier) |
Build a declaration string, which requires converting both a type and putting an identifier in the syntactically correct position. More... | |
Protected Member Functions | |
virtual std::string | convert_rec (const typet &src, const qualifierst &qualifiers, const std::string &declarator) |
virtual std::string | convert_struct_type (const typet &src, const std::string &qualifiers_str, const std::string &declarator_str) |
To generate C-like string for defining the given struct. More... | |
std::string | convert_struct_type (const typet &src, const std::string &qualifer_str, const std::string &declarator_str, bool inc_struct_body, bool inc_padding_components) |
To generate C-like string for declaring (or defining) the given struct. More... | |
virtual std::string | convert_array_type (const typet &src, const qualifierst &qualifiers, const std::string &declarator_str) |
To generate a C-like type declaration of an array. More... | |
std::string | convert_array_type (const typet &src, const qualifierst &qualifiers, const std::string &declarator_str, bool inc_size_if_possible) |
To generate a C-like type declaration of an array. More... | |
irep_idt | id_shorthand (const irep_idt &identifier) const |
std::string | convert_typecast (const typecast_exprt &src, unsigned &precedence) |
std::string | convert_pointer_arithmetic (const exprt &src, unsigned &precedence) |
std::string | convert_pointer_difference (const exprt &src, unsigned &precedence) |
std::string | convert_binary (const exprt &src, const std::string &symbol, unsigned precedence, bool full_parentheses) |
std::string | convert_multi_ary (const exprt &src, const std::string &symbol, unsigned precedence, bool full_parentheses) |
std::string | convert_cond (const exprt &src, unsigned precedence) |
std::string | convert_struct_member_value (const exprt &src, unsigned precedence) |
std::string | convert_array_member_value (const exprt &src, unsigned precedence) |
std::string | convert_member (const member_exprt &src, unsigned precedence) |
std::string | convert_array_of (const exprt &src, unsigned precedence) |
std::string | convert_trinary (const exprt &src, const std::string &symbol1, const std::string &symbol2, unsigned precedence) |
std::string | convert_overflow (const exprt &src, unsigned &precedence) |
std::string | convert_quantifier (const exprt &src, const std::string &symbol, unsigned precedence) |
std::string | convert_with (const exprt &src, unsigned precedence) |
std::string | convert_update (const exprt &src, unsigned precedence) |
std::string | convert_member_designator (const exprt &src) |
std::string | convert_index_designator (const exprt &src) |
std::string | convert_index (const exprt &src, unsigned precedence) |
std::string | convert_byte_extract (const exprt &src, unsigned precedence) |
std::string | convert_byte_update (const exprt &src, unsigned precedence) |
std::string | convert_extractbit (const exprt &src, unsigned precedence) |
std::string | convert_extractbits (const exprt &src, unsigned precedence) |
std::string | convert_unary (const exprt &src, const std::string &symbol, unsigned precedence) |
std::string | convert_unary_post (const exprt &src, const std::string &symbol, unsigned precedence) |
std::string | convert_function (const exprt &src, const std::string &symbol, unsigned precedence) |
std::string | convert_complex (const exprt &src, unsigned precedence) |
std::string | convert_comma (const exprt &src, unsigned precedence) |
std::string | convert_Hoare (const exprt &src) |
std::string | convert_code (const codet &src) |
virtual std::string | convert_code (const codet &src, unsigned indent) |
std::string | convert_code_label (const code_labelt &src, unsigned indent) |
std::string | convert_code_switch_case (const code_switch_caset &src, unsigned indent) |
std::string | convert_code_asm (const code_asmt &src, unsigned indent) |
std::string | convert_code_assign (const code_assignt &src, unsigned indent) |
std::string | convert_code_ifthenelse (const code_ifthenelset &src, unsigned indent) |
std::string | convert_code_for (const code_fort &src, unsigned indent) |
std::string | convert_code_while (const code_whilet &src, unsigned indent) |
std::string | convert_code_dowhile (const code_dowhilet &src, unsigned indent) |
std::string | convert_code_block (const code_blockt &src, unsigned indent) |
std::string | convert_code_expression (const codet &src, unsigned indent) |
std::string | convert_code_return (const codet &src, unsigned indent) |
std::string | convert_code_goto (const codet &src, unsigned indent) |
std::string | convert_code_assume (const codet &src, unsigned indent) |
std::string | convert_code_assert (const codet &src, unsigned indent) |
std::string | convert_code_break (const codet &src, unsigned indent) |
std::string | convert_code_switch (const codet &src, unsigned indent) |
std::string | convert_code_continue (const codet &src, unsigned indent) |
std::string | convert_code_decl (const codet &src, unsigned indent) |
std::string | convert_code_decl_block (const codet &src, unsigned indent) |
std::string | convert_code_dead (const codet &src, unsigned indent) |
std::string | convert_code_function_call (const code_function_callt &src, unsigned indent) |
std::string | convert_code_lock (const codet &src, unsigned indent) |
std::string | convert_code_unlock (const codet &src, unsigned indent) |
std::string | convert_code_printf (const codet &src, unsigned indent) |
std::string | convert_code_fence (const codet &src, unsigned indent) |
std::string | convert_code_input (const codet &src, unsigned indent) |
std::string | convert_code_output (const codet &src, unsigned indent) |
std::string | convert_code_array_set (const codet &src, unsigned indent) |
std::string | convert_code_array_copy (const codet &src, unsigned indent) |
std::string | convert_code_array_replace (const codet &src, unsigned indent) |
virtual std::string | convert_with_precedence (const exprt &src, unsigned &precedence) |
std::string | convert_function_application (const function_application_exprt &src, unsigned &precedence) |
std::string | convert_side_effect_expr_function_call (const side_effect_expr_function_callt &src, unsigned &precedence) |
std::string | convert_allocate (const exprt &src, unsigned &precedence) |
std::string | convert_nondet (const exprt &src, unsigned &precedence) |
std::string | convert_prob_coin (const exprt &src, unsigned &precedence) |
std::string | convert_prob_uniform (const exprt &src, unsigned &precedence) |
std::string | convert_statement_expression (const exprt &src, unsigned &precendence) |
virtual std::string | convert_symbol (const exprt &src, unsigned &precedence) |
std::string | convert_predicate_symbol (const exprt &src, unsigned &precedence) |
std::string | convert_predicate_next_symbol (const exprt &src, unsigned &precedence) |
std::string | convert_predicate_passive_symbol (const exprt &src, unsigned &precedence) |
std::string | convert_nondet_symbol (const nondet_symbol_exprt &, unsigned &precedence) |
std::string | convert_quantified_symbol (const exprt &src, unsigned &precedence) |
std::string | convert_nondet_bool (const exprt &src, unsigned &precedence) |
std::string | convert_object_descriptor (const exprt &src, unsigned &precedence) |
std::string | convert_literal (const exprt &src, unsigned &precedence) |
virtual std::string | convert_constant (const constant_exprt &src, unsigned &precedence) |
virtual std::string | convert_constant_bool (bool boolean_value) |
To get the C-like representation of a given boolean value. More... | |
std::string | convert_norep (const exprt &src, unsigned &precedence) |
virtual std::string | convert_struct (const exprt &src, unsigned &precedence) |
std::string | convert_union (const exprt &src, unsigned &precedence) |
std::string | convert_vector (const exprt &src, unsigned &precedence) |
std::string | convert_array (const exprt &src, unsigned &precedence) |
std::string | convert_array_list (const exprt &src, unsigned &precedence) |
std::string | convert_initializer_list (const exprt &src, unsigned &precedence) |
std::string | convert_designated_initializer (const exprt &src, unsigned &precedence) |
std::string | convert_concatenation (const exprt &src, unsigned &precedence) |
std::string | convert_sizeof (const exprt &src, unsigned &precedence) |
std::string | convert_let (const let_exprt &, unsigned precedence) |
std::string | convert_struct (const exprt &src, unsigned &precedence, bool include_padding_components) |
To generate a C-like string representing a struct. More... | |
Static Protected Member Functions | |
static std::string | indent_str (unsigned indent) |
Protected Attributes | |
const namespacet & | ns |
const expr2c_configurationt & | configuration |
std::unordered_map< irep_idt, std::unordered_set< irep_idt > > | ns_collision |
std::unordered_map< irep_idt, irep_idt > | shorthands |
unsigned | sizeof_nesting |
Definition at line 25 of file expr2c_class.h.
|
inlineexplicit |
Definition at line 28 of file expr2c_class.h.
|
inlinevirtual |
Definition at line 35 of file expr2c_class.h.
|
virtual |
Reimplemented in expr2javat.
Definition at line 3937 of file expr2c.cpp.
|
virtual |
Reimplemented in expr2javat.
Definition at line 183 of file expr2c.cpp.
|
protected |
Definition at line 1188 of file expr2c.cpp.
|
protected |
Definition at line 2184 of file expr2c.cpp.
|
protected |
Definition at line 2287 of file expr2c.cpp.
|
protected |
Definition at line 1643 of file expr2c.cpp.
|
protected |
Definition at line 1362 of file expr2c.cpp.
|
protectedvirtual |
To generate a C-like type declaration of an array.
Includes the size of the array in the []
src | The array type to convert |
qualifiers | Any qualifiers on the type |
declarator_str | Previously computed string denoting the array symbol |
Definition at line 752 of file expr2c.cpp.
|
protected |
To generate a C-like type declaration of an array.
Optionally can include or exclude the size of the array in the []
src | The array type to convert |
qualifiers | Any qualifiers on the type |
declarator_str | Previously computed string denoting the array symbol |
inc_size_if_possible | Should the generated string include the size of the array (if it is known). |
Definition at line 769 of file expr2c.cpp.
|
protected |
Definition at line 1061 of file expr2c.cpp.
|
protected |
Definition at line 1372 of file expr2c.cpp.
|
protected |
Definition at line 1397 of file expr2c.cpp.
|
protected |
Definition at line 3334 of file expr2c.cpp.
|
protectedvirtual |
Reimplemented in expr2cppt, and expr2javat.
Definition at line 2888 of file expr2c.cpp.
|
protected |
Definition at line 3216 of file expr2c.cpp.
|
protected |
Definition at line 3238 of file expr2c.cpp.
|
protected |
Definition at line 3194 of file expr2c.cpp.
|
protected |
Definition at line 2463 of file expr2c.cpp.
|
protected |
Definition at line 3259 of file expr2c.cpp.
|
protected |
Definition at line 3014 of file expr2c.cpp.
|
protected |
Definition at line 3272 of file expr2c.cpp.
|
protected |
Definition at line 2828 of file expr2c.cpp.
|
protected |
Definition at line 2667 of file expr2c.cpp.
|
protected |
Definition at line 2721 of file expr2c.cpp.
|
protected |
Definition at line 2777 of file expr2c.cpp.
|
protected |
Definition at line 2732 of file expr2c.cpp.
|
protected |
Definition at line 2851 of file expr2c.cpp.
|
protected |
Definition at line 2567 of file expr2c.cpp.
|
protected |
Definition at line 2866 of file expr2c.cpp.
|
protected |
Definition at line 3121 of file expr2c.cpp.
|
protected |
Definition at line 2791 of file expr2c.cpp.
|
protected |
Definition at line 3051 of file expr2c.cpp.
|
protected |
Definition at line 2655 of file expr2c.cpp.
|
protected |
Definition at line 2596 of file expr2c.cpp.
|
protected |
Definition at line 3151 of file expr2c.cpp.
|
protected |
Definition at line 3286 of file expr2c.cpp.
|
protected |
Definition at line 3025 of file expr2c.cpp.
|
protected |
Definition at line 3173 of file expr2c.cpp.
|
protected |
Definition at line 3099 of file expr2c.cpp.
|
protected |
Definition at line 2633 of file expr2c.cpp.
|
protected |
Definition at line 2678 of file expr2c.cpp.
|
protected |
Definition at line 3304 of file expr2c.cpp.
|
protected |
Definition at line 3038 of file expr2c.cpp.
|
protected |
Definition at line 2541 of file expr2c.cpp.
|
protected |
Definition at line 1287 of file expr2c.cpp.
|
protected |
Definition at line 1311 of file expr2c.cpp.
|
protected |
|
protected |
Definition at line 1027 of file expr2c.cpp.
|
protectedvirtual |
Reimplemented in expr2cppt, and expr2javat.
Definition at line 1787 of file expr2c.cpp.
|
protectedvirtual |
To get the C-like representation of a given boolean value.
boolean_value | The value of the constant bool expression |
Definition at line 2019 of file expr2c.cpp.
|
protected |
Definition at line 2349 of file expr2c.cpp.
|
protected |
Definition at line 3382 of file expr2c.cpp.
|
protected |
Definition at line 3397 of file expr2c.cpp.
|
protected |
Definition at line 1263 of file expr2c.cpp.
|
protected |
Definition at line 2367 of file expr2c.cpp.
|
protected |
Definition at line 3339 of file expr2c.cpp.
|
protected |
Definition at line 1449 of file expr2c.cpp.
|
protected |
Definition at line 1557 of file expr2c.cpp.
|
protected |
Definition at line 2321 of file expr2c.cpp.
|
protected |
Definition at line 963 of file expr2c.cpp.
|
protected |
Definition at line 1246 of file expr2c.cpp.
|
protected |
Definition at line 1567 of file expr2c.cpp.
|
protected |
Definition at line 1547 of file expr2c.cpp.
|
protected |
Definition at line 1116 of file expr2c.cpp.
|
protected |
Definition at line 1215 of file expr2c.cpp.
|
protected |
Definition at line 1756 of file expr2c.cpp.
|
protected |
Definition at line 1716 of file expr2c.cpp.
|
protected |
Definition at line 1663 of file expr2c.cpp.
|
protected |
Definition at line 1763 of file expr2c.cpp.
|
protected |
Definition at line 2427 of file expr2c.cpp.
|
protected |
Definition at line 1473 of file expr2c.cpp.
|
protected |
Definition at line 1510 of file expr2c.cpp.
|
protected |
Definition at line 1732 of file expr2c.cpp.
|
protected |
Definition at line 1740 of file expr2c.cpp.
|
protected |
Definition at line 1724 of file expr2c.cpp.
|
protected |
Definition at line 1236 of file expr2c.cpp.
|
protected |
Definition at line 1253 of file expr2c.cpp.
|
protected |
Definition at line 1748 of file expr2c.cpp.
|
protected |
Definition at line 873 of file expr2c.cpp.
|
protectedvirtual |
Reimplemented in expr2cppt, and expr2javat.
Definition at line 188 of file expr2c.cpp.
|
protected |
Definition at line 2397 of file expr2c.cpp.
|
protected |
Definition at line 3414 of file expr2c.cpp.
|
protected |
Definition at line 1225 of file expr2c.cpp.
|
protectedvirtual |
Reimplemented in expr2cppt, and expr2javat.
Definition at line 2027 of file expr2c.cpp.
|
protected |
To generate a C-like string representing a struct.
Can optionally include the padding parameters.
src | The struct declaration expression | |
[out] | precedence | Precedence of the top level operator in the resulting string, used to decide about adding parentheses |
include_padding_components | Should the generated C code include the padding members added to structs for GOTOs benefit |
Definition at line 2043 of file expr2c.cpp.
|
protected |
Definition at line 1653 of file expr2c.cpp.
|
protected |
To generate C-like string for declaring (or defining) the given struct.
src | the struct type being converted |
qualifiers | any qualifiers on the type |
declarator | the declarator on the type |
inc_struct_body | when generating the code, should we include a complete definition of the struct |
inc_padding_components | should the padding parameters be included Note this only makes sense if inc_struct_body |
Definition at line 698 of file expr2c.cpp.
|
protectedvirtual |
To generate C-like string for defining the given struct.
src | the struct type being converted |
qualifiers_str | any qualifiers on the type |
declarator_str | the declarator on the type |
Definition at line 675 of file expr2c.cpp.
|
protectedvirtual |
Definition at line 1674 of file expr2c.cpp.
|
protected |
Definition at line 823 of file expr2c.cpp.
|
protected |
Definition at line 789 of file expr2c.cpp.
|
protected |
Definition at line 1165 of file expr2c.cpp.
|
protected |
Definition at line 1427 of file expr2c.cpp.
|
protected |
Definition at line 2163 of file expr2c.cpp.
|
protected |
Definition at line 983 of file expr2c.cpp.
|
protected |
Definition at line 2116 of file expr2c.cpp.
|
protected |
Definition at line 895 of file expr2c.cpp.
std::string expr2ct::convert_with_identifier | ( | const typet & | src, |
const std::string & | identifier | ||
) |
Build a declaration string, which requires converting both a type and putting an identifier in the syntactically correct position.
src | the type to convert |
identifier | the identifier to use as the type |
Definition at line 3948 of file expr2c.cpp.
|
protectedvirtual |
Reimplemented in expr2cppt, and expr2javat.
Definition at line 3428 of file expr2c.cpp.
void expr2ct::get_shorthands | ( | const exprt & | expr | ) |
Definition at line 109 of file expr2c.cpp.
Definition at line 66 of file expr2c.cpp.
|
staticprotected |
Definition at line 2458 of file expr2c.cpp.
|
protected |
Definition at line 47 of file expr2c_class.h.
|
protected |
Definition at line 46 of file expr2c_class.h.
Definition at line 79 of file expr2c_class.h.
Definition at line 80 of file expr2c_class.h.
|
protected |
Definition at line 82 of file expr2c_class.h.