cprover
expr2c.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_H
11 #define CPROVER_ANSI_C_EXPR2C_H
12 
13 #include <string>
14 
15 class exprt;
16 class namespacet;
17 class typet;
18 
21 {
25 
29 
32 
34  std::string true_string;
35 
37  std::string false_string;
38 
41  const bool print_struct_body_in_type,
42  const bool include_array_size,
43  std::string true_string,
44  std::string false_string)
48  true_string(std::move(true_string)),
49  false_string(std::move(false_string))
50  {
51  }
52 
56 
60 };
61 
62 std::string expr2c(const exprt &expr, const namespacet &ns);
63 
64 std::string expr2c(
65  const exprt &expr,
66  const namespacet &ns,
67  const expr2c_configurationt &configuration);
68 
69 std::string type2c(const typet &type, const namespacet &ns);
70 
71 std::string type2c(
72  const typet &type,
73  const namespacet &ns,
74  const expr2c_configurationt &configuration);
75 
76 std::string type2c(
77  const typet &type,
78  const std::string &identifier,
79  const namespacet &ns,
80  const expr2c_configurationt &configuration);
81 
82 #endif // CPROVER_ANSI_C_EXPR2C_H
The type of an expression, extends irept.
Definition: type.h:27
std::string true_string
This is the string that will be printed for the true boolean expression.
Definition: expr2c.h:34
Used for configuring the behaviour of expr2c and type2c.
Definition: expr2c.h:20
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:55
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition: namespace.h:93
std::string type2c(const typet &type, const namespacet &ns)
Definition: expr2c.cpp:3981
bool include_struct_padding_components
When printing struct_typet or struct_exprt, include the artificial padding components introduced to k...
Definition: expr2c.h:24
bool print_struct_body_in_type
When printing a struct_typet, should the components of the struct be printed inline.
Definition: expr2c.h:28
bool include_array_size
When printing array_typet, should the size of the array be printed.
Definition: expr2c.h:31
Base class for all expressions.
Definition: expr.h:54
std::string expr2c(const exprt &expr, const namespacet &ns)
Definition: expr2c.cpp:3966
std::string false_string
This is the string that will be printed for the false boolean expression.
Definition: expr2c.h:37
expr2c_configurationt(const bool include_struct_padding_components, const bool print_struct_body_in_type, const bool include_array_size, std::string true_string, std::string false_string)
Definition: expr2c.h:39
static expr2c_configurationt clean_configuration
This prints compilable C that loses some of the internal details of the GOTO program.
Definition: expr2c.h:59