CBMC
expr2c_class.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module:
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
9 
10 #ifndef CPROVER_ANSI_C_EXPR2C_CLASS_H
11 #define CPROVER_ANSI_C_EXPR2C_CLASS_H
12 
13 #include "expr2c.h"
14 
15 #include <string>
16 #include <unordered_map>
17 #include <unordered_set>
18 
20 
21 #include <util/bitvector_expr.h>
22 #include <util/byte_operators.h>
23 #include <util/mathematical_expr.h>
24 #include <util/std_code.h>
25 
27 class qualifierst;
28 class namespacet;
29 
30 class expr2ct
31 {
32 public:
33  explicit expr2ct(
34  const namespacet &_ns,
38  {
39  }
40  virtual ~expr2ct() { }
41 
42  virtual std::string convert(const typet &src);
43  virtual std::string convert(const exprt &src);
44 
45  void get_shorthands(const exprt &expr);
46 
47  std::string
48  convert_with_identifier(const typet &src, const std::string &identifier);
49 
50 protected:
51  const namespacet &ns;
53 
54  virtual std::string convert_rec(
55  const typet &src,
56  const qualifierst &qualifiers,
57  const std::string &declarator);
58 
59  virtual std::string convert_struct_type(
60  const typet &src,
61  const std::string &qualifiers_str,
62  const std::string &declarator_str);
63 
64  std::string convert_struct_type(
65  const typet &src,
66  const std::string &qualifer_str,
67  const std::string &declarator_str,
68  bool inc_struct_body,
69  bool inc_padding_components);
70 
71  virtual std::string convert_array_type(
72  const typet &src,
73  const qualifierst &qualifiers,
74  const std::string &declarator_str);
75 
76  std::string convert_array_type(
77  const typet &src,
78  const qualifierst &qualifiers,
79  const std::string &declarator_str,
80  bool inc_size_if_possible);
81 
82  static std::string indent_str(unsigned indent);
83 
84  std::unordered_map<irep_idt, std::unordered_set<irep_idt>> ns_collision;
85  std::unordered_map<irep_idt, irep_idt> shorthands;
86 
87  unsigned sizeof_nesting;
88 
89  irep_idt id_shorthand(const irep_idt &identifier) const;
90 
91  std::string convert_typecast(
92  const typecast_exprt &src, unsigned &precedence);
93 
94  std::string convert_pointer_arithmetic(
95  const exprt &src,
96  unsigned &precedence);
97 
98  std::string convert_pointer_difference(
99  const exprt &src,
100  unsigned &precedence);
101 
102  std::string convert_binary(
103  const binary_exprt &,
104  const std::string &symbol,
105  unsigned precedence,
106  bool full_parentheses);
107 
108  std::string convert_multi_ary(
109  const exprt &src, const std::string &symbol,
110  unsigned precedence, bool full_parentheses);
111 
112  std::string convert_cond(
113  const exprt &src, unsigned precedence);
114 
115  std::string convert_struct_member_value(
116  const exprt &src, unsigned precedence);
117 
118  std::string convert_array_member_value(
119  const exprt &src, unsigned precedence);
120 
121  std::string convert_member(
122  const member_exprt &src, unsigned precedence);
123 
124  std::string convert_array_of(const exprt &src, unsigned precedence);
125 
126  std::string convert_trinary(
127  const ternary_exprt &src,
128  const std::string &symbol1,
129  const std::string &symbol2,
130  unsigned precedence);
131 
139  std::string convert_rox(const shift_exprt &src, unsigned precedence);
140 
141  std::string convert_overflow(
142  const exprt &src, unsigned &precedence);
143 
144  std::string convert_binding(
145  const binding_exprt &,
146  const std::string &symbol,
147  unsigned precedence);
148 
149  std::string convert_with(
150  const exprt &src, unsigned precedence);
151 
152  std::string convert_update(const update_exprt &, unsigned precedence);
153 
154  std::string convert_member_designator(
155  const exprt &src);
156 
157  std::string convert_index_designator(
158  const exprt &src);
159 
160  std::string convert_index(const binary_exprt &, unsigned precedence);
161 
162  std::string
163  convert_byte_extract(const byte_extract_exprt &, unsigned precedence);
164 
165  std::string
166  convert_byte_update(const byte_update_exprt &, unsigned precedence);
167 
168  std::string convert_extractbit(const extractbit_exprt &, unsigned precedence);
169 
170  std::string
171  convert_extractbits(const extractbits_exprt &src, unsigned precedence);
172 
173  std::string convert_unary(
174  const unary_exprt &,
175  const std::string &symbol,
176  unsigned precedence);
177 
178  std::string convert_unary_post(
179  const exprt &src, const std::string &symbol,
180  unsigned precedence);
181 
185  std::string convert_function(const exprt &src, const std::string &symbol);
186 
187  std::string convert_complex(
188  const exprt &src,
189  unsigned precedence);
190 
191  std::string convert_comma(
192  const exprt &src,
193  unsigned precedence);
194 
195  std::string convert_Hoare(const exprt &src);
196 
197  std::string convert_code(const codet &src);
198  virtual std::string convert_code(const codet &src, unsigned indent);
199  std::string convert_code_label(const code_labelt &src, unsigned indent);
200  // NOLINTNEXTLINE(whitespace/line_length)
201  std::string convert_code_switch_case(const code_switch_caset &src, unsigned indent);
202  std::string convert_code_asm(const code_asmt &src, unsigned indent);
203  std::string
204  convert_code_frontend_assign(const code_frontend_assignt &, unsigned indent);
205  // NOLINTNEXTLINE(whitespace/line_length)
206  std::string convert_code_ifthenelse(const code_ifthenelset &src, unsigned indent);
207  std::string convert_code_for(const code_fort &src, unsigned indent);
208  std::string convert_code_while(const code_whilet &src, unsigned indent);
209  std::string convert_code_dowhile(const code_dowhilet &src, unsigned indent);
210  std::string convert_code_block(const code_blockt &src, unsigned indent);
211  std::string convert_code_expression(const codet &src, unsigned indent);
212  std::string convert_code_return(const codet &src, unsigned indent);
213  std::string convert_code_goto(const codet &src, unsigned indent);
214  std::string convert_code_assume(const codet &src, unsigned indent);
215  std::string convert_code_assert(const codet &src, unsigned indent);
216  std::string convert_code_break(unsigned indent);
217  std::string convert_code_switch(const codet &src, unsigned indent);
218  std::string convert_code_continue(unsigned indent);
219  std::string convert_code_frontend_decl(const codet &, unsigned indent);
220  std::string convert_code_decl_block(const codet &src, unsigned indent);
221  std::string convert_code_dead(const codet &src, unsigned indent);
222  // NOLINTNEXTLINE(whitespace/line_length)
223  std::string convert_code_function_call(const code_function_callt &src, unsigned indent);
224  std::string convert_code_lock(const codet &src, unsigned indent);
225  std::string convert_code_unlock(const codet &src, unsigned indent);
226  std::string convert_code_printf(const codet &src, unsigned indent);
227  std::string convert_code_fence(const codet &src, unsigned indent);
228  std::string convert_code_input(const codet &src, unsigned indent);
229  std::string convert_code_output(const codet &src, unsigned indent);
230  std::string convert_code_array_set(const codet &src, unsigned indent);
231  std::string convert_code_array_copy(const codet &src, unsigned indent);
232  std::string convert_code_array_replace(const codet &src, unsigned indent);
233 
234  virtual std::string convert_with_precedence(
235  const exprt &src, unsigned &precedence);
236 
237  std::string
241  std::string convert_allocate(const exprt &src, unsigned &precedence);
242  std::string convert_nondet(const exprt &src, unsigned &precedence);
243  std::string convert_prob_coin(const exprt &src, unsigned &precedence);
244  std::string convert_prob_uniform(const exprt &src, unsigned &precedence);
245  // NOLINTNEXTLINE(whitespace/line_length)
246  std::string convert_statement_expression(const exprt &src, unsigned &precendence);
247 
248  virtual std::string convert_symbol(const exprt &src);
249  std::string convert_predicate_symbol(const exprt &src);
250  std::string convert_predicate_next_symbol(const exprt &src);
251  std::string convert_predicate_passive_symbol(const exprt &src);
252  std::string convert_nondet_symbol(const nondet_symbol_exprt &);
253  std::string convert_quantified_symbol(const exprt &src);
254  std::string convert_nondet_bool();
255  std::string convert_object_descriptor(const exprt &src, unsigned &precedence);
256  std::string convert_literal(const exprt &src);
257  // NOLINTNEXTLINE(whitespace/line_length)
258  virtual std::string convert_constant(const constant_exprt &src, unsigned &precedence);
259  virtual std::string convert_constant_bool(bool boolean_value);
260  virtual std::string convert_annotated_pointer_constant(
262  unsigned &precedence);
263 
264  std::string convert_norep(const exprt &src, unsigned &precedence);
265 
266  virtual std::string convert_struct(const exprt &src, unsigned &precedence);
267  std::string convert_union(const exprt &src, unsigned &precedence);
268  std::string convert_vector(const exprt &src, unsigned &precedence);
269  std::string convert_array(const exprt &src);
270  std::string convert_array_list(const exprt &src, unsigned &precedence);
271  std::string convert_initializer_list(const exprt &src);
272  std::string convert_designated_initializer(const exprt &src);
273  std::string convert_concatenation(const exprt &src, unsigned &precedence);
274  std::string convert_sizeof(const exprt &src, unsigned &precedence);
275  std::string convert_let(const let_exprt &, unsigned precedence);
276 
277  std::string convert_struct(
278  const exprt &src,
279  unsigned &precedence,
280  bool include_padding_components);
281 
282  std::string convert_conditional_target_group(const exprt &src);
283  std::string convert_bitreverse(const bitreverse_exprt &src);
284 };
285 
286 #endif // CPROVER_ANSI_C_EXPR2C_CLASS_H
dstringt
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition: dstring.h:36
expr2ct::convert_code_while
std::string convert_code_while(const code_whilet &src, unsigned indent)
Definition: expr2c.cpp:2622
code_blockt
A codet representing sequential composition of program statements.
Definition: std_code.h:129
expr2ct::convert_bitreverse
std::string convert_bitreverse(const bitreverse_exprt &src)
Definition: expr2c.cpp:3536
expr2ct::convert_prob_uniform
std::string convert_prob_uniform(const exprt &src, unsigned &precedence)
Definition: expr2c.cpp:1215
code_switch_caset
codet representation of a switch-case, i.e. a case statement within a switch.
Definition: std_code.h:1022
expr2ct::convert_code_fence
std::string convert_code_fence(const codet &src, unsigned indent)
Definition: expr2c.cpp:3212
expr2ct::convert_cond
std::string convert_cond(const exprt &src, unsigned precedence)
Definition: expr2c.cpp:992
byte_update_exprt
Expression corresponding to op() where the bytes starting at position offset (given in number of byte...
Definition: byte_operators.h:77
code_whilet
codet representing a while statement.
Definition: std_code.h:609
nondet_symbol_exprt
Expression to hold a nondeterministic choice.
Definition: std_expr.h:241
goto_instruction_code.h
expr2ct::convert_union
std::string convert_union(const exprt &src, unsigned &precedence)
Definition: expr2c.cpp:2168
expr2ct::convert_conditional_target_group
std::string convert_conditional_target_group(const exprt &src)
Definition: expr2c.cpp:3511
code_asmt
codet representation of an inline assembler statement.
Definition: std_code.h:1252
expr2ct::convert_annotated_pointer_constant
virtual std::string convert_annotated_pointer_constant(const annotated_pointer_constant_exprt &src, unsigned &precedence)
Definition: expr2c.cpp:2011
code_fort
codet representation of a for statement.
Definition: std_code.h:733
expr2ct::convert_statement_expression
std::string convert_statement_expression(const exprt &src, unsigned &precendence)
Definition: expr2c.cpp:1185
typet
The type of an expression, extends irept.
Definition: type.h:28
ternary_exprt
An expression with three operands.
Definition: std_expr.h:48
expr2ct::convert_comma
std::string convert_comma(const exprt &src, unsigned precedence)
Definition: expr2c.cpp:1247
expr2ct::convert_pointer_arithmetic
std::string convert_pointer_arithmetic(const exprt &src, unsigned &precedence)
Definition: expr2c.cpp:1423
expr2ct::convert_code_assert
std::string convert_code_assert(const codet &src, unsigned indent)
Definition: expr2c.cpp:3350
expr2ct::convert_with_identifier
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 sy...
Definition: expr2c.cpp:4039
side_effect_expr_function_callt
A side_effect_exprt representation of a function call side effect.
Definition: std_code.h:1691
expr2ct::convert_code_function_call
std::string convert_code_function_call(const code_function_callt &src, unsigned indent)
Definition: expr2c.cpp:3142
expr2ct::convert_constant
virtual std::string convert_constant(const constant_exprt &src, unsigned &precedence)
Definition: expr2c.cpp:1769
expr2ct::convert_update
std::string convert_update(const update_exprt &, unsigned precedence)
Definition: expr2c.cpp:954
expr2ct::convert_let
std::string convert_let(const let_exprt &, unsigned precedence)
Definition: expr2c.cpp:927
expr2ct::convert_byte_extract
std::string convert_byte_extract(const byte_extract_exprt &, unsigned precedence)
Definition: expr2c.cpp:1331
expr2ct::convert_nondet_bool
std::string convert_nondet_bool()
Definition: expr2c.cpp:1694
expr2ct::convert_code_decl_block
std::string convert_code_decl_block(const codet &src, unsigned indent)
Definition: expr2c.cpp:2926
expr2ct::convert_code_expression
std::string convert_code_expression(const codet &src, unsigned indent)
Definition: expr2c.cpp:2941
exprt
Base class for all expressions.
Definition: expr.h:55
expr2ct::convert_quantified_symbol
std::string convert_quantified_symbol(const exprt &src)
Definition: expr2c.cpp:1688
unary_exprt
Generic base class for unary expressions.
Definition: std_expr.h:313
expr2ct::convert_array_list
std::string convert_array_list(const exprt &src, unsigned &precedence)
Definition: expr2c.cpp:2288
binary_exprt
A base class for binary expressions.
Definition: std_expr.h:582
expr2c_configurationt::default_configuration
static expr2c_configurationt default_configuration
This prints a human readable C like syntax that closely mirrors the internals of the GOTO program.
Definition: expr2c.h:71
expr2ct::expr2ct
expr2ct(const namespacet &_ns, const expr2c_configurationt &configuration=expr2c_configurationt::default_configuration)
Definition: expr2c_class.h:33
expr2ct::convert_code_input
std::string convert_code_input(const codet &src, unsigned indent)
Definition: expr2c.cpp:3242
expr2ct::convert_Hoare
std::string convert_Hoare(const exprt &src)
Definition: expr2c.cpp:3430
expr2ct::convert_code
std::string convert_code(const codet &src)
Definition: expr2c.cpp:3425
expr2ct::convert_constant_bool
virtual std::string convert_constant_bool(bool boolean_value)
To get the C-like representation of a given boolean value.
Definition: expr2c.cpp:2024
expr2ct::convert_array_of
std::string convert_array_of(const exprt &src, unsigned precedence)
Definition: expr2c.cpp:1321
expr2ct::convert_unary_post
std::string convert_unary_post(const exprt &src, const std::string &symbol, unsigned precedence)
Definition: expr2c.cpp:1382
expr2ct::~expr2ct
virtual ~expr2ct()
Definition: expr2c_class.h:40
expr2ct::convert_code_ifthenelse
std::string convert_code_ifthenelse(const code_ifthenelset &src, unsigned indent)
Definition: expr2c.cpp:2677
qualifierst
Definition: c_qualifiers.h:19
expr2ct::convert_struct_type
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.
Definition: expr2c.cpp:638
expr2ct::convert_code_switch_case
std::string convert_code_switch_case(const code_switch_caset &src, unsigned indent)
Definition: expr2c.cpp:3395
expr2ct::convert_predicate_symbol
std::string convert_predicate_symbol(const exprt &src)
Definition: expr2c.cpp:1670
expr2ct::shorthands
std::unordered_map< irep_idt, irep_idt > shorthands
Definition: expr2c_class.h:85
code_ifthenelset
codet representation of an if-then-else statement.
Definition: std_code.h:459
expr2ct::convert_trinary
std::string convert_trinary(const ternary_exprt &src, const std::string &symbol1, const std::string &symbol2, unsigned precedence)
Definition: expr2c.cpp:788
expr2ct::sizeof_nesting
unsigned sizeof_nesting
Definition: expr2c_class.h:87
expr2ct::convert_overflow
std::string convert_overflow(const exprt &src, unsigned &precedence)
Definition: expr2c.cpp:2508
expr2ct::ns_collision
std::unordered_map< irep_idt, std::unordered_set< irep_idt > > ns_collision
Definition: expr2c_class.h:84
namespacet
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition: namespace.h:90
expr2ct::convert_code_frontend_decl
std::string convert_code_frontend_decl(const codet &, unsigned indent)
Definition: expr2c.cpp:2809
expr2ct::convert_typecast
std::string convert_typecast(const typecast_exprt &src, unsigned &precedence)
Definition: expr2c.cpp:754
code_function_callt
goto_instruction_codet representation of a function call statement.
Definition: goto_instruction_code.h:271
expr2ct::convert_predicate_passive_symbol
std::string convert_predicate_passive_symbol(const exprt &src)
Definition: expr2c.cpp:1682
expr2ct
Definition: expr2c_class.h:30
expr2ct::convert
virtual std::string convert(const typet &src)
Definition: expr2c.cpp:214
byte_operators.h
Expression classes for byte-level operators.
code_dowhilet
codet representation of a do while statement.
Definition: std_code.h:671
expr2ct::convert_code_array_set
std::string convert_code_array_set(const codet &src, unsigned indent)
Definition: expr2c.cpp:3285
expr2ct::convert_code_for
std::string convert_code_for(const code_fort &src, unsigned indent)
Definition: expr2c.cpp:2866
expr2ct::convert_member_designator
std::string convert_member_designator(const exprt &src)
Definition: expr2c.cpp:1499
expr2ct::convert_array_member_value
std::string convert_array_member_value(const exprt &src, unsigned precedence)
Definition: expr2c.cpp:1593
expr2ct::convert_nondet_symbol
std::string convert_nondet_symbol(const nondet_symbol_exprt &)
Definition: expr2c.cpp:1664
expr2ct::convert_code_printf
std::string convert_code_printf(const codet &src, unsigned indent)
Definition: expr2c.cpp:3190
expr2ct::indent_str
static std::string indent_str(unsigned indent)
Definition: expr2c.cpp:2539
expr2c.h
code_labelt
codet representation of a label for branch targets.
Definition: std_code.h:958
expr2ct::convert_pointer_difference
std::string convert_pointer_difference(const exprt &src, unsigned &precedence)
Definition: expr2c.cpp:1460
expr2ct::convert_prob_coin
std::string convert_prob_coin(const exprt &src, unsigned &precedence)
Definition: expr2c.cpp:1200
expr2ct::convert_code_frontend_assign
std::string convert_code_frontend_assign(const code_frontend_assignt &, unsigned indent)
Definition: expr2c.cpp:3108
expr2ct::convert_code_asm
std::string convert_code_asm(const code_asmt &src, unsigned indent)
Definition: expr2c.cpp:2544
function_application_exprt
Application of (mathematical) function.
Definition: mathematical_expr.h:196
expr2ct::convert_code_lock
std::string convert_code_lock(const codet &src, unsigned indent)
Definition: expr2c.cpp:3116
expr2ct::convert_code_label
std::string convert_code_label(const code_labelt &src, unsigned indent)
Definition: expr2c.cpp:3377
expr2ct::convert_unary
std::string convert_unary(const unary_exprt &, const std::string &symbol, unsigned precedence)
Definition: expr2c.cpp:1127
expr2ct::convert_extractbits
std::string convert_extractbits(const extractbits_exprt &src, unsigned precedence)
Definition: expr2c.cpp:3485
code_frontend_assignt
A codet representing an assignment in the program.
Definition: std_code.h:23
expr2ct::convert_array
std::string convert_array(const exprt &src)
Definition: expr2c.cpp:2187
expr2ct::convert_code_goto
std::string convert_code_goto(const codet &src, unsigned indent)
Definition: expr2c.cpp:2735
expr2ct::convert_symbol
virtual std::string convert_symbol(const exprt &src)
Definition: expr2c.cpp:1624
expr2ct::convert_predicate_next_symbol
std::string convert_predicate_next_symbol(const exprt &src)
Definition: expr2c.cpp:1676
expr2ct::convert_byte_update
std::string convert_byte_update(const byte_update_exprt &, unsigned precedence)
Definition: expr2c.cpp:1357
binding_exprt
A base class for variable bindings (quantifiers, let, lambda)
Definition: std_expr.h:3051
expr2ct::convert_code_assume
std::string convert_code_assume(const codet &src, unsigned indent)
Definition: expr2c.cpp:3363
expr2ct::convert_struct
virtual std::string convert_struct(const exprt &src, unsigned &precedence)
Definition: expr2c.cpp:2032
annotated_pointer_constant_exprt
Pointer-typed bitvector constant annotated with the pointer expression that the bitvector is the nume...
Definition: pointer_expr.h:817
expr2ct::convert_index
std::string convert_index(const binary_exprt &, unsigned precedence)
Definition: expr2c.cpp:1404
expr2ct::convert_initializer_list
std::string convert_initializer_list(const exprt &src)
Definition: expr2c.cpp:2322
expr2ct::convert_side_effect_expr_function_call
std::string convert_side_effect_expr_function_call(const side_effect_expr_function_callt &src)
Definition: expr2c.cpp:2479
expr2ct::configuration
const expr2c_configurationt & configuration
Definition: expr2c_class.h:52
std_code.h
optionalt
nonstd::optional< T > optionalt
Definition: optional.h:35
update_exprt
Operator to update elements in structs and arrays.
Definition: std_expr.h:2607
expr2ct::convert_code_continue
std::string convert_code_continue(unsigned indent)
Definition: expr2c.cpp:2799
expr2ct::convert_code_break
std::string convert_code_break(unsigned indent)
Definition: expr2c.cpp:2747
expr2ct::convert_code_array_copy
std::string convert_code_array_copy(const codet &src, unsigned indent)
Definition: expr2c.cpp:3307
expr2ct::convert_extractbit
std::string convert_extractbit(const extractbit_exprt &, unsigned precedence)
Definition: expr2c.cpp:3474
extractbit_exprt
Extracts a single bit of a bit-vector operand.
Definition: bitvector_expr.h:380
expr2ct::convert_norep
std::string convert_norep(const exprt &src, unsigned &precedence)
Definition: expr2c.cpp:1613
expr2ct::convert_literal
std::string convert_literal(const exprt &src)
Definition: expr2c.cpp:1210
member_exprt
Extract member of struct or union.
Definition: std_expr.h:2793
expr2ct::ns
const namespacet & ns
Definition: expr2c_class.h:51
expr2ct::convert_function_application
std::string convert_function_application(const function_application_exprt &src)
Definition: expr2c.cpp:2451
shift_exprt
A base class for shift and rotate operators.
Definition: bitvector_expr.h:229
expr2ct::convert_with
std::string convert_with(const exprt &src, unsigned precedence)
Definition: expr2c.cpp:858
expr2ct::convert_code_block
std::string convert_code_block(const code_blockt &src, unsigned indent)
Definition: expr2c.cpp:2903
expr2ct::convert_code_array_replace
std::string convert_code_array_replace(const codet &src, unsigned indent)
Definition: expr2c.cpp:3329
expr2ct::convert_code_unlock
std::string convert_code_unlock(const codet &src, unsigned indent)
Definition: expr2c.cpp:3129
expr2ct::convert_nondet
std::string convert_nondet(const exprt &src, unsigned &precedence)
Definition: expr2c.cpp:1175
expr2ct::get_shorthands
void get_shorthands(const exprt &expr)
Definition: expr2c.cpp:117
expr2ct::convert_code_dowhile
std::string convert_code_dowhile(const code_dowhilet &src, unsigned indent)
Definition: expr2c.cpp:2648
expr2ct::convert_object_descriptor
std::string convert_object_descriptor(const exprt &src, unsigned &precedence)
Definition: expr2c.cpp:1699
byte_extract_exprt
Expression of type type extracted from some object op starting at position offset (given in number of...
Definition: byte_operators.h:28
expr2ct::convert_sizeof
std::string convert_sizeof(const exprt &src, unsigned &precedence)
Definition: expr2c.cpp:3497
expr2ct::convert_array_type
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.
Definition: expr2c.cpp:715
expr2ct::id_shorthand
irep_idt id_shorthand(const irep_idt &identifier) const
Definition: expr2c.cpp:76
expr2ct::convert_code_dead
std::string convert_code_dead(const codet &src, unsigned indent)
Definition: expr2c.cpp:2852
expr2ct::convert_concatenation
std::string convert_concatenation(const exprt &src, unsigned &precedence)
extractbits_exprt
Extracts a sub-range of a bit-vector operand.
Definition: bitvector_expr.h:447
expr2ct::convert_struct_member_value
std::string convert_struct_member_value(const exprt &src, unsigned precedence)
Definition: expr2c.cpp:1603
expr2ct::convert_rox
std::string convert_rox(const shift_exprt &src, unsigned precedence)
Conversion function from rol/ror expressions to C code strings Note that this constructs a complex ex...
Definition: expr2c.cpp:2348
expr2ct::convert_rec
virtual std::string convert_rec(const typet &src, const qualifierst &qualifiers, const std::string &declarator)
Definition: expr2c.cpp:219
expr2ct::convert_index_designator
std::string convert_index_designator(const exprt &src)
Definition: expr2c.cpp:1509
expr2c_configurationt
Used for configuring the behaviour of expr2c and type2c.
Definition: expr2c.h:20
typecast_exprt
Semantic type conversion.
Definition: std_expr.h:2016
expr2ct::convert_code_switch
std::string convert_code_switch(const codet &src, unsigned indent)
Definition: expr2c.cpp:2756
expr2ct::convert_member
std::string convert_member(const member_exprt &src, unsigned precedence)
Definition: expr2c.cpp:1519
constant_exprt
A constant literal expression.
Definition: std_expr.h:2941
expr2ct::convert_with_precedence
virtual std::string convert_with_precedence(const exprt &src, unsigned &precedence)
Definition: expr2c.cpp:3552
expr2ct::convert_multi_ary
std::string convert_multi_ary(const exprt &src, const std::string &symbol, unsigned precedence, bool full_parentheses)
Definition: expr2c.cpp:1078
expr2ct::convert_complex
std::string convert_complex(const exprt &src, unsigned precedence)
Definition: expr2c.cpp:1271
expr2ct::convert_code_output
std::string convert_code_output(const codet &src, unsigned indent)
Definition: expr2c.cpp:3264
expr2ct::convert_function
optionalt< std::string > convert_function(const exprt &src)
Returns a string if src is a function with a known conversion, else returns nullopt.
Definition: expr2c.cpp:3969
expr2ct::convert_designated_initializer
std::string convert_designated_initializer(const exprt &src)
Definition: expr2c.cpp:2408
expr2ct::convert_vector
std::string convert_vector(const exprt &src, unsigned &precedence)
Definition: expr2c.cpp:2121
expr2ct::convert_binary
std::string convert_binary(const binary_exprt &, const std::string &symbol, unsigned precedence, bool full_parentheses)
Definition: expr2c.cpp:1026
let_exprt
A let expression.
Definition: std_expr.h:3141
bitvector_expr.h
expr2ct::convert_allocate
std::string convert_allocate(const exprt &src, unsigned &precedence)
Definition: expr2c.cpp:1147
expr2ct::convert_code_return
std::string convert_code_return(const codet &src, unsigned indent)
Definition: expr2c.cpp:2714
bitreverse_exprt
Reverse the order of bits in a bit-vector.
Definition: bitvector_expr.h:1156
mathematical_expr.h
codet
Data structure for representing an arbitrary statement in a program.
Definition: std_code_base.h:28
expr2ct::convert_binding
std::string convert_binding(const binding_exprt &, const std::string &symbol, unsigned precedence)
Definition: expr2c.cpp:835