CBMC
convert_bool_literal.cpp
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Statement List Language Conversion
4 
5 Author: Matthias Weiss, matthias.weiss@diffblue.com
6 
7 \*******************************************************************/
8 
11 
12 #include "convert_bool_literal.h"
13 
14 #include <algorithm>
15 #include <util/std_types.h>
16 // Needed for back_inserter in Visual Studio.
17 #include <iterator>
18 
19 constant_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)
The Boolean type.
Definition: std_types.h:36
A constant literal expression.
Definition: std_expr.h:3000
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.