cprover
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 
17 class jsont;
18 class json_objectt;
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 
41 #endif // CPROVER_UTIL_JSON_IREP_H
bool include_comments
Definition: json_irep.h:38
std::vector< irept > subt
Definition: irep.h:90
Definition: json.h:23
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:79
Base class for tree-like data structures with sharing.
Definition: irep.h:86
std::map< irep_namet, irept > named_subt
Definition: irep.h:99
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:32
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:23
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:55
irept convert_from_json(const jsont &) const
Deserialize a JSON irep representation.
Definition: json_irep.cpp:99