cprover
expr2ct Class Reference

#include <expr2c_class.h>

+ Inheritance diagram for expr2ct:
+ Collaboration diagram for expr2ct:

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 namespacetns
 
const expr2c_configurationtconfiguration
 
std::unordered_map< irep_idt, std::unordered_set< irep_idt > > ns_collision
 
std::unordered_map< irep_idt, irep_idtshorthands
 
unsigned sizeof_nesting
 

Detailed Description

Definition at line 25 of file expr2c_class.h.

Constructor & Destructor Documentation

◆ expr2ct()

expr2ct::expr2ct ( const namespacet _ns,
const expr2c_configurationt configuration = expr2c_configurationt::default_configuration 
)
inlineexplicit

Definition at line 28 of file expr2c_class.h.

◆ ~expr2ct()

virtual expr2ct::~expr2ct ( )
inlinevirtual

Definition at line 35 of file expr2c_class.h.

Member Function Documentation

◆ convert() [1/2]

std::string expr2ct::convert ( const typet src)
virtual

Reimplemented in expr2javat.

Definition at line 183 of file expr2c.cpp.

◆ convert() [2/2]

std::string expr2ct::convert ( const exprt src)
virtual

Reimplemented in expr2javat.

Definition at line 3936 of file expr2c.cpp.

◆ convert_allocate()

std::string expr2ct::convert_allocate ( const exprt src,
unsigned &  precedence 
)
protected

Definition at line 1188 of file expr2c.cpp.

◆ convert_array()

std::string expr2ct::convert_array ( const exprt src,
unsigned &  precedence 
)
protected

Definition at line 2183 of file expr2c.cpp.

◆ convert_array_list()

std::string expr2ct::convert_array_list ( const exprt src,
unsigned &  precedence 
)
protected

Definition at line 2286 of file expr2c.cpp.

◆ convert_array_member_value()

std::string expr2ct::convert_array_member_value ( const exprt src,
unsigned  precedence 
)
protected

Definition at line 1643 of file expr2c.cpp.

◆ convert_array_of()

std::string expr2ct::convert_array_of ( const exprt src,
unsigned  precedence 
)
protected

Definition at line 1362 of file expr2c.cpp.

◆ convert_array_type() [1/2]

std::string expr2ct::convert_array_type ( const typet src,
const qualifierst qualifiers,
const std::string &  declarator_str 
)
protectedvirtual

To generate a C-like type declaration of an array.

Includes the size of the array in the []

Parameters
srcThe array type to convert qualifier declarator_str
Returns
A C-like type declaration of an array

Definition at line 752 of file expr2c.cpp.

◆ convert_array_type() [2/2]

std::string expr2ct::convert_array_type ( const typet src,
const qualifierst qualifiers,
const std::string &  declarator_str,
bool  inc_size_if_possible 
)
protected

To generate a C-like type declaration of an array.

Optionally can include or exclude the size of the array in the []

Parameters
srcThe array type to convert qualifier declarator_str
inc_size_if_possibleShould the generated string include the size of the array (if it is known).
Returns
A C-like type declaration of an array

Definition at line 769 of file expr2c.cpp.

◆ convert_binary()

std::string expr2ct::convert_binary ( const exprt src,
const std::string &  symbol,
unsigned  precedence,
bool  full_parentheses 
)
protected

Definition at line 1061 of file expr2c.cpp.

◆ convert_byte_extract()

std::string expr2ct::convert_byte_extract ( const exprt src,
unsigned  precedence 
)
protected

Definition at line 1372 of file expr2c.cpp.

◆ convert_byte_update()

std::string expr2ct::convert_byte_update ( const exprt src,
unsigned  precedence 
)
protected

Definition at line 1397 of file expr2c.cpp.

◆ convert_code() [1/2]

std::string expr2ct::convert_code ( const codet src)
protected

Definition at line 3333 of file expr2c.cpp.

◆ convert_code() [2/2]

std::string expr2ct::convert_code ( const codet src,
unsigned  indent 
)
protectedvirtual

Reimplemented in expr2cppt, and expr2javat.

Definition at line 2887 of file expr2c.cpp.

◆ convert_code_array_copy()

std::string expr2ct::convert_code_array_copy ( const codet src,
unsigned  indent 
)
protected

Definition at line 3215 of file expr2c.cpp.

◆ convert_code_array_replace()

std::string expr2ct::convert_code_array_replace ( const codet src,
unsigned  indent 
)
protected

Definition at line 3237 of file expr2c.cpp.

◆ convert_code_array_set()

std::string expr2ct::convert_code_array_set ( const codet src,
unsigned  indent 
)
protected

Definition at line 3193 of file expr2c.cpp.

◆ convert_code_asm()

std::string expr2ct::convert_code_asm ( const code_asmt src,
unsigned  indent 
)
protected

Definition at line 2462 of file expr2c.cpp.

◆ convert_code_assert()

std::string expr2ct::convert_code_assert ( const codet src,
unsigned  indent 
)
protected

Definition at line 3258 of file expr2c.cpp.

◆ convert_code_assign()

std::string expr2ct::convert_code_assign ( const code_assignt src,
unsigned  indent 
)
protected

Definition at line 3013 of file expr2c.cpp.

◆ convert_code_assume()

std::string expr2ct::convert_code_assume ( const codet src,
unsigned  indent 
)
protected

Definition at line 3271 of file expr2c.cpp.

◆ convert_code_block()

std::string expr2ct::convert_code_block ( const code_blockt src,
unsigned  indent 
)
protected

Definition at line 2827 of file expr2c.cpp.

◆ convert_code_break()

std::string expr2ct::convert_code_break ( const codet src,
unsigned  indent 
)
protected

Definition at line 2666 of file expr2c.cpp.

◆ convert_code_continue()

std::string expr2ct::convert_code_continue ( const codet src,
unsigned  indent 
)
protected

Definition at line 2720 of file expr2c.cpp.

◆ convert_code_dead()

std::string expr2ct::convert_code_dead ( const codet src,
unsigned  indent 
)
protected

Definition at line 2776 of file expr2c.cpp.

◆ convert_code_decl()

std::string expr2ct::convert_code_decl ( const codet src,
unsigned  indent 
)
protected

Definition at line 2731 of file expr2c.cpp.

◆ convert_code_decl_block()

std::string expr2ct::convert_code_decl_block ( const codet src,
unsigned  indent 
)
protected

Definition at line 2850 of file expr2c.cpp.

◆ convert_code_dowhile()

std::string expr2ct::convert_code_dowhile ( const code_dowhilet src,
unsigned  indent 
)
protected

Definition at line 2566 of file expr2c.cpp.

◆ convert_code_expression()

std::string expr2ct::convert_code_expression ( const codet src,
unsigned  indent 
)
protected

Definition at line 2865 of file expr2c.cpp.

◆ convert_code_fence()

std::string expr2ct::convert_code_fence ( const codet src,
unsigned  indent 
)
protected

Definition at line 3120 of file expr2c.cpp.

◆ convert_code_for()

std::string expr2ct::convert_code_for ( const code_fort src,
unsigned  indent 
)
protected

Definition at line 2790 of file expr2c.cpp.

◆ convert_code_function_call()

std::string expr2ct::convert_code_function_call ( const code_function_callt src,
unsigned  indent 
)
protected

Definition at line 3050 of file expr2c.cpp.

◆ convert_code_goto()

std::string expr2ct::convert_code_goto ( const codet src,
unsigned  indent 
)
protected

Definition at line 2654 of file expr2c.cpp.

◆ convert_code_ifthenelse()

std::string expr2ct::convert_code_ifthenelse ( const code_ifthenelset src,
unsigned  indent 
)
protected

Definition at line 2595 of file expr2c.cpp.

◆ convert_code_input()

std::string expr2ct::convert_code_input ( const codet src,
unsigned  indent 
)
protected

Definition at line 3150 of file expr2c.cpp.

◆ convert_code_label()

std::string expr2ct::convert_code_label ( const code_labelt src,
unsigned  indent 
)
protected

Definition at line 3285 of file expr2c.cpp.

◆ convert_code_lock()

std::string expr2ct::convert_code_lock ( const codet src,
unsigned  indent 
)
protected

Definition at line 3024 of file expr2c.cpp.

◆ convert_code_output()

std::string expr2ct::convert_code_output ( const codet src,
unsigned  indent 
)
protected

Definition at line 3172 of file expr2c.cpp.

◆ convert_code_printf()

std::string expr2ct::convert_code_printf ( const codet src,
unsigned  indent 
)
protected

Definition at line 3098 of file expr2c.cpp.

◆ convert_code_return()

std::string expr2ct::convert_code_return ( const codet src,
unsigned  indent 
)
protected

Definition at line 2632 of file expr2c.cpp.

◆ convert_code_switch()

std::string expr2ct::convert_code_switch ( const codet src,
unsigned  indent 
)
protected

Definition at line 2677 of file expr2c.cpp.

◆ convert_code_switch_case()

std::string expr2ct::convert_code_switch_case ( const code_switch_caset src,
unsigned  indent 
)
protected

Definition at line 3303 of file expr2c.cpp.

◆ convert_code_unlock()

std::string expr2ct::convert_code_unlock ( const codet src,
unsigned  indent 
)
protected

Definition at line 3037 of file expr2c.cpp.

◆ convert_code_while()

std::string expr2ct::convert_code_while ( const code_whilet src,
unsigned  indent 
)
protected

Definition at line 2540 of file expr2c.cpp.

◆ convert_comma()

std::string expr2ct::convert_comma ( const exprt src,
unsigned  precedence 
)
protected

Definition at line 1287 of file expr2c.cpp.

◆ convert_complex()

std::string expr2ct::convert_complex ( const exprt src,
unsigned  precedence 
)
protected

Definition at line 1311 of file expr2c.cpp.

◆ convert_concatenation()

std::string expr2ct::convert_concatenation ( const exprt src,
unsigned &  precedence 
)
protected

◆ convert_cond()

std::string expr2ct::convert_cond ( const exprt src,
unsigned  precedence 
)
protected

Definition at line 1027 of file expr2c.cpp.

◆ convert_constant()

std::string expr2ct::convert_constant ( const constant_exprt src,
unsigned &  precedence 
)
protectedvirtual

Reimplemented in expr2cppt, and expr2javat.

Definition at line 1787 of file expr2c.cpp.

◆ convert_constant_bool()

std::string expr2ct::convert_constant_bool ( bool  boolean_value)
protectedvirtual

To get the C-like representation of a given boolean value.

Parameters
boolean_valueThe value of the constant bool expression
Returns
Returns a C-like representation of the boolean value, e.g. TRUE or FALSE.

Definition at line 2019 of file expr2c.cpp.

◆ convert_designated_initializer()

std::string expr2ct::convert_designated_initializer ( const exprt src,
unsigned &  precedence 
)
protected

Definition at line 2348 of file expr2c.cpp.

◆ convert_extractbit()

std::string expr2ct::convert_extractbit ( const exprt src,
unsigned  precedence 
)
protected

Definition at line 3381 of file expr2c.cpp.

◆ convert_extractbits()

std::string expr2ct::convert_extractbits ( const exprt src,
unsigned  precedence 
)
protected

Definition at line 3396 of file expr2c.cpp.

◆ convert_function()

std::string expr2ct::convert_function ( const exprt src,
const std::string &  symbol,
unsigned  precedence 
)
protected

Definition at line 1263 of file expr2c.cpp.

◆ convert_function_application()

std::string expr2ct::convert_function_application ( const function_application_exprt src,
unsigned &  precedence 
)
protected

Definition at line 2366 of file expr2c.cpp.

◆ convert_Hoare()

std::string expr2ct::convert_Hoare ( const exprt src)
protected

Definition at line 3338 of file expr2c.cpp.

◆ convert_index()

std::string expr2ct::convert_index ( const exprt src,
unsigned  precedence 
)
protected

Definition at line 1449 of file expr2c.cpp.

◆ convert_index_designator()

std::string expr2ct::convert_index_designator ( const exprt src)
protected

Definition at line 1557 of file expr2c.cpp.

◆ convert_initializer_list()

std::string expr2ct::convert_initializer_list ( const exprt src,
unsigned &  precedence 
)
protected

Definition at line 2320 of file expr2c.cpp.

◆ convert_let()

std::string expr2ct::convert_let ( const let_exprt src,
unsigned  precedence 
)
protected

Definition at line 963 of file expr2c.cpp.

◆ convert_literal()

std::string expr2ct::convert_literal ( const exprt src,
unsigned &  precedence 
)
protected

Definition at line 1246 of file expr2c.cpp.

◆ convert_member()

std::string expr2ct::convert_member ( const member_exprt src,
unsigned  precedence 
)
protected

Definition at line 1567 of file expr2c.cpp.

◆ convert_member_designator()

std::string expr2ct::convert_member_designator ( const exprt src)
protected

Definition at line 1547 of file expr2c.cpp.

◆ convert_multi_ary()

std::string expr2ct::convert_multi_ary ( const exprt src,
const std::string &  symbol,
unsigned  precedence,
bool  full_parentheses 
)
protected

Definition at line 1116 of file expr2c.cpp.

◆ convert_nondet()

std::string expr2ct::convert_nondet ( const exprt src,
unsigned &  precedence 
)
protected

Definition at line 1215 of file expr2c.cpp.

◆ convert_nondet_bool()

std::string expr2ct::convert_nondet_bool ( const exprt src,
unsigned &  precedence 
)
protected

Definition at line 1756 of file expr2c.cpp.

◆ convert_nondet_symbol()

std::string expr2ct::convert_nondet_symbol ( const nondet_symbol_exprt src,
unsigned &  precedence 
)
protected

Definition at line 1716 of file expr2c.cpp.

◆ convert_norep()

std::string expr2ct::convert_norep ( const exprt src,
unsigned &  precedence 
)
protected

Definition at line 1663 of file expr2c.cpp.

◆ convert_object_descriptor()

std::string expr2ct::convert_object_descriptor ( const exprt src,
unsigned &  precedence 
)
protected

Definition at line 1763 of file expr2c.cpp.

◆ convert_overflow()

std::string expr2ct::convert_overflow ( const exprt src,
unsigned &  precedence 
)
protected

Definition at line 2426 of file expr2c.cpp.

◆ convert_pointer_arithmetic()

std::string expr2ct::convert_pointer_arithmetic ( const exprt src,
unsigned &  precedence 
)
protected

Definition at line 1473 of file expr2c.cpp.

◆ convert_pointer_difference()

std::string expr2ct::convert_pointer_difference ( const exprt src,
unsigned &  precedence 
)
protected

Definition at line 1510 of file expr2c.cpp.

◆ convert_predicate_next_symbol()

std::string expr2ct::convert_predicate_next_symbol ( const exprt src,
unsigned &  precedence 
)
protected

Definition at line 1732 of file expr2c.cpp.

◆ convert_predicate_passive_symbol()

std::string expr2ct::convert_predicate_passive_symbol ( const exprt src,
unsigned &  precedence 
)
protected

Definition at line 1740 of file expr2c.cpp.

◆ convert_predicate_symbol()

std::string expr2ct::convert_predicate_symbol ( const exprt src,
unsigned &  precedence 
)
protected

Definition at line 1724 of file expr2c.cpp.

◆ convert_prob_coin()

std::string expr2ct::convert_prob_coin ( const exprt src,
unsigned &  precedence 
)
protected

Definition at line 1236 of file expr2c.cpp.

◆ convert_prob_uniform()

std::string expr2ct::convert_prob_uniform ( const exprt src,
unsigned &  precedence 
)
protected

Definition at line 1253 of file expr2c.cpp.

◆ convert_quantified_symbol()

std::string expr2ct::convert_quantified_symbol ( const exprt src,
unsigned &  precedence 
)
protected

Definition at line 1748 of file expr2c.cpp.

◆ convert_quantifier()

std::string expr2ct::convert_quantifier ( const exprt src,
const std::string &  symbol,
unsigned  precedence 
)
protected

Definition at line 873 of file expr2c.cpp.

◆ convert_rec()

std::string expr2ct::convert_rec ( const typet src,
const qualifierst qualifiers,
const std::string &  declarator 
)
protectedvirtual

Reimplemented in expr2cppt, and expr2javat.

Definition at line 188 of file expr2c.cpp.

◆ convert_side_effect_expr_function_call()

std::string expr2ct::convert_side_effect_expr_function_call ( const side_effect_expr_function_callt src,
unsigned &  precedence 
)
protected

Definition at line 2396 of file expr2c.cpp.

◆ convert_sizeof()

std::string expr2ct::convert_sizeof ( const exprt src,
unsigned &  precedence 
)
protected

Definition at line 3413 of file expr2c.cpp.

◆ convert_statement_expression()

std::string expr2ct::convert_statement_expression ( const exprt src,
unsigned &  precendence 
)
protected

Definition at line 1225 of file expr2c.cpp.

◆ convert_struct() [1/2]

std::string expr2ct::convert_struct ( const exprt src,
unsigned &  precedence 
)
protectedvirtual

Reimplemented in expr2cppt, and expr2javat.

Definition at line 2027 of file expr2c.cpp.

◆ convert_struct() [2/2]

std::string expr2ct::convert_struct ( const exprt src,
unsigned &  precedence,
bool  include_padding_components 
)
protected

To generate a C-like string representing a struct.

Can optionally include the padding parameters.

Parameters
srcThe struct declaration expression precedence
include_padding_componentsShould the generated C code include the padding members added to structs for GOTOs benefit
Returns
A string representation of the struct expression

Definition at line 2042 of file expr2c.cpp.

◆ convert_struct_member_value()

std::string expr2ct::convert_struct_member_value ( const exprt src,
unsigned  precedence 
)
protected

Definition at line 1653 of file expr2c.cpp.

◆ convert_struct_type() [1/2]

std::string expr2ct::convert_struct_type ( const typet src,
const std::string &  qualifiers_str,
const std::string &  declarator_str 
)
protectedvirtual

To generate C-like string for defining the given struct.

Parameters
srcthe struct type being converted
qualifiersany qualifiers on the type
declaratorthe declarator on the type
Returns
Returns a type declaration for a struct, containing the body of the struct and in that body the padding parameters.

Definition at line 675 of file expr2c.cpp.

◆ convert_struct_type() [2/2]

std::string expr2ct::convert_struct_type ( const typet src,
const std::string &  qualifiers,
const std::string &  declarator,
bool  inc_struct_body,
bool  inc_padding_components 
)
protected

To generate C-like string for declaring (or defining) the given struct.

Parameters
srcthe struct type being converted
qualifiersany qualifiers on the type
declaratorthe declarator on the type
inc_struct_bodywhen generating the code, should we include a complete definition of the struct
inc_padding_componentsshould the padding parameters be included Note this only makes sense if inc_struct_body
Returns
Returns a type declaration for a struct, optionally containing the body of the struct (and in that body, optionally the padding parameters).

Definition at line 698 of file expr2c.cpp.

◆ convert_symbol()

std::string expr2ct::convert_symbol ( const exprt src,
unsigned &  precedence 
)
protectedvirtual

Definition at line 1674 of file expr2c.cpp.

◆ convert_trinary()

std::string expr2ct::convert_trinary ( const exprt src,
const std::string &  symbol1,
const std::string &  symbol2,
unsigned  precedence 
)
protected

Definition at line 823 of file expr2c.cpp.

◆ convert_typecast()

std::string expr2ct::convert_typecast ( const typecast_exprt src,
unsigned &  precedence 
)
protected

Definition at line 789 of file expr2c.cpp.

◆ convert_unary()

std::string expr2ct::convert_unary ( const exprt src,
const std::string &  symbol,
unsigned  precedence 
)
protected

Definition at line 1165 of file expr2c.cpp.

◆ convert_unary_post()

std::string expr2ct::convert_unary_post ( const exprt src,
const std::string &  symbol,
unsigned  precedence 
)
protected

Definition at line 1427 of file expr2c.cpp.

◆ convert_union()

std::string expr2ct::convert_union ( const exprt src,
unsigned &  precedence 
)
protected

Definition at line 2162 of file expr2c.cpp.

◆ convert_update()

std::string expr2ct::convert_update ( const exprt src,
unsigned  precedence 
)
protected

Definition at line 983 of file expr2c.cpp.

◆ convert_vector()

std::string expr2ct::convert_vector ( const exprt src,
unsigned &  precedence 
)
protected

Definition at line 2115 of file expr2c.cpp.

◆ convert_with()

std::string expr2ct::convert_with ( const exprt src,
unsigned  precedence 
)
protected

Definition at line 895 of file expr2c.cpp.

◆ convert_with_identifier()

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.

Parameters
srcthe type to convert
identifierthe identifier to use as the type
Returns
A C declaration of the given type with the right identifier.

Definition at line 3947 of file expr2c.cpp.

◆ convert_with_precedence()

std::string expr2ct::convert_with_precedence ( const exprt src,
unsigned &  precedence 
)
protectedvirtual

Reimplemented in expr2cppt, and expr2javat.

Definition at line 3427 of file expr2c.cpp.

◆ get_shorthands()

void expr2ct::get_shorthands ( const exprt expr)

Definition at line 109 of file expr2c.cpp.

◆ id_shorthand()

irep_idt expr2ct::id_shorthand ( const irep_idt identifier) const
protected

Definition at line 66 of file expr2c.cpp.

◆ indent_str()

std::string expr2ct::indent_str ( unsigned  indent)
staticprotected

Definition at line 2457 of file expr2c.cpp.

Member Data Documentation

◆ configuration

const expr2c_configurationt& expr2ct::configuration
protected

Definition at line 47 of file expr2c_class.h.

◆ ns

const namespacet& expr2ct::ns
protected

Definition at line 46 of file expr2c_class.h.

◆ ns_collision

std::unordered_map<irep_idt, std::unordered_set<irep_idt> > expr2ct::ns_collision
protected

Definition at line 79 of file expr2c_class.h.

◆ shorthands

std::unordered_map<irep_idt, irep_idt> expr2ct::shorthands
protected

Definition at line 80 of file expr2c_class.h.

◆ sizeof_nesting

unsigned expr2ct::sizeof_nesting
protected

Definition at line 82 of file expr2c_class.h.


The documentation for this class was generated from the following files: