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 <util/irep.h>
16 class jsont;
17 class json_objectt;
18 
20 {
21 public:
22  explicit json_irept(bool include_comments);
23  void convert_from_irep(const irept &irep, jsont &json) const;
24  void convert_from_json(const jsont &, irept &) const;
25 
26 private:
27  void convert_sub_tree(
28  const std::string &sub_tree_id,
29  const irept::subt &sub_trees,
30  json_objectt &parent) const;
31 
33  const std::string &sub_tree_id,
34  const irept::named_subt &sub_trees,
35  json_objectt &parent) const;
36 
38 };
39 
40 #endif // CPROVER_UTIL_JSON_IREP_H
void convert_from_irep(const irept &irep, jsont &json) const
To convert to JSON from an irep structure by recursively generating JSON for the different sub trees...
Definition: json_irep.cpp:31
bool include_comments
Definition: json_irep.h:37
std::vector< irept > subt
Definition: irep.h:91
Definition: json.h:21
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:76
Base class for tree-like data structures with sharing.
Definition: irep.h:87
std::map< irep_namet, irept > named_subt
Definition: irep.h:100
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:51
void convert_from_json(const jsont &, irept &) const
Deserialize a JSON irep representation.
Definition: json_irep.cpp:97
json_objectt json(const source_locationt &location)
Definition: json_expr.cpp:23