CBMC
json_irep.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Util
4 
5 Author: Thomas Kiley, thomas.kiley@diffblue.com
6 
7 \*******************************************************************/
8 
11 
12 #ifndef CPROVER_UTIL_JSON_IREP_H
13 #define CPROVER_UTIL_JSON_IREP_H
14 
15 #include "irep.h"
16 #include "json.h"
17 
18 class source_locationt;
19 
21 {
22 public:
23  explicit json_irept(bool include_comments);
24  json_objectt convert_from_irep(const irept &) const;
25  irept convert_from_json(const jsont &) const;
26 
27 private:
28  void convert_sub_tree(
29  const std::string &sub_tree_id,
30  const irept::subt &sub_trees,
31  json_objectt &parent) const;
32 
34  const std::string &sub_tree_id,
35  const irept::named_subt &sub_trees,
36  json_objectt &parent) const;
37 
39 };
40 
42 
43 #endif // CPROVER_UTIL_JSON_IREP_H
json_irept::include_comments
bool include_comments
Definition: json_irep.h:38
json
json_objectt json(const source_locationt &)
Definition: json_irep.cpp:139
sharing_treet< irept, forward_list_as_mapt< irep_idt, irept > >::named_subt
typename dt::named_subt named_subt
Definition: irep.h:161
jsont
Definition: json.h:26
json_objectt
Definition: json.h:299
json_irept::convert_from_irep
json_objectt convert_from_irep(const irept &) const
To convert to JSON from an irep structure by recursively generating JSON for the different sub trees.
Definition: json_irep.cpp:31
sharing_treet< irept, forward_list_as_mapt< irep_idt, irept > >::subt
typename dt::subt subt
Definition: irep.h:160
json_irept::convert_named_sub_tree
void convert_named_sub_tree(const std::string &sub_tree_id, const irept::named_subt &sub_trees, json_objectt &parent) const
To convert to JSON from a map of ireps that are in a named subtree.
Definition: json_irep.cpp:74
source_locationt
Definition: source_location.h:18
json_irept::convert_sub_tree
void convert_sub_tree(const std::string &sub_tree_id, const irept::subt &sub_trees, json_objectt &parent) const
To convert to JSON from a list of ireps that are in an unlabelled subtree.
Definition: json_irep.cpp:50
json_irept::json_irept
json_irept(bool include_comments)
To convert to JSON from an irep structure by recursively generating JSON for the different sub trees.
Definition: json_irep.cpp:22
json.h
irept
There are a large number of kinds of tree structured or tree-like data in CPROVER.
Definition: irep.h:359
json_irept
Definition: json_irep.h:20
irep.h
json_irept::convert_from_json
irept convert_from_json(const jsont &) const
Deserialize a JSON irep representation.
Definition: json_irep.cpp:95