CBMC
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
convert_bool_literal.cpp
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: Statement List Language Conversion
4
5Author: Matthias Weiss, matthias.weiss@diffblue.com
6
7\*******************************************************************/
8
11
13
14#include <algorithm>
15#include <util/std_types.h>
16// Needed for back_inserter in Visual Studio.
17#include <iterator>
18
19constant_exprt convert_bool_literal(const std::string &src)
20{
21 std::string copy;
22 transform(begin(src), end(src), back_inserter(copy), ::tolower);
23 bool_typet type;
24 return constant_exprt(copy, type);
25}
static abstract_object_pointert transform(const exprt &expr, const std::vector< abstract_object_pointert > &operands, const abstract_environmentt &environment, const namespacet &ns)
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
The Boolean type.
Definition std_types.h:36
A constant literal expression.
Definition std_expr.h:3117
constant_exprt convert_bool_literal(const std::string &src)
Converts a string into the corresponding 'Bool' expression.
Statement List Language Conversion.
int tolower(int c)
Definition ctype.c:109
Pre-defined types.