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
There are a large number of kinds of tree structured or tree-like data in CPROVER.
Definition: irep.h:360
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
bool include_comments
Definition: json_irep.h:38
irept convert_from_json(const jsont &) const
Deserialize a JSON irep representation.
Definition: json_irep.cpp:95
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
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
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
Definition: json.h:27
json_objectt json(const source_locationt &)
Definition: json_irep.cpp:139