CBMC
convert_string_value.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_string_value.h"
13 
14 string_constantt convert_identifier(const std::string &src)
15 {
16  string_constantt result{src};
17  result.set(ID_statement_list_type, ID_statement_list_identifier);
18  return result;
19 }
20 
21 string_constantt convert_title(const std::string &src)
22 {
23  string_constantt result{src};
24  result.set(ID_statement_list_type, ID_statement_list_title);
25  return result;
26 }
27 
28 string_constantt convert_version(const std::string &src)
29 {
30  string_constantt result{src};
31  result.set(ID_statement_list_type, ID_statement_list_version);
32  return result;
33 }
34 
35 string_constantt convert_label(const std::string &src)
36 {
37  // Cut the trailing colon
38  std::string value = src.substr(0, src.length() - 1);
39 
40  string_constantt result{value};
41  result.set(ID_statement_list_type, ID_label);
42  return result;
43 }
void set(const irep_idt &name, const irep_idt &value)
Definition: irep.h:412
string_constantt convert_title(const std::string &src)
Converts a string into a Statement List title.
string_constantt convert_identifier(const std::string &src)
Converts a string into a Statement List identifier.
string_constantt convert_version(const std::string &src)
Converts a string into a Statement List version.
string_constantt convert_label(const std::string &src)
Converts a string into a Statement List label.
Statement List Language Conversion.