cprover
java_class_loader.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module:
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
9 
10 #ifndef CPROVER_JAVA_BYTECODE_JAVA_CLASS_LOADER_H
11 #define CPROVER_JAVA_BYTECODE_JAVA_CLASS_LOADER_H
12 
13 #include <map>
14 #include <regex>
15 #include <set>
16 
17 #include <util/message.h>
18 
21 #include "jar_file.h"
22 
24 {
25 public:
27 
28  void set_java_cp_include_files(std::string &);
29 
30  // maps class names to the parse trees
31  typedef std::map<irep_idt, java_bytecode_parse_treet> class_mapt;
33 
34  static std::string file_to_class_name(const std::string &);
35  static std::string class_name_to_file(const irep_idt &);
36 
37  void add_jar_file(const std::string &f)
38  {
39  jar_files.push_back(f);
40  }
41 
42  void load_entire_jar(java_class_loader_limitt &, const std::string &f);
43 
45 
47  {
48  public:
49  struct entryt
50  {
51  std::string class_file_name;
52  };
53 
54  // class name to index map
55  typedef std::map<irep_idt, entryt> entriest;
57  };
58 
59  // maps jar files to maps of class names
60  typedef std::map<irep_idt, jar_map_entryt> jar_mapt;
62 
64 
65  // get a parse tree for given class
68 
69  std::list<std::string> jar_files;
70  std::string java_cp_include_files;
71 };
72 
73 #endif // CPROVER_JAVA_BYTECODE_JAVA_CLASS_LOADER_H
std::list< std::string > jar_files
void load_entire_jar(java_class_loader_limitt &, const std::string &f)
java_bytecode_parse_treet & get_parse_tree(java_class_loader_limitt &, const irep_idt &)
std::map< irep_idt, java_bytecode_parse_treet > class_mapt
static std::string file_to_class_name(const std::string &)
void add_jar_file(const std::string &f)
void set_java_cp_include_files(std::string &)
JAR File Reading.
java_bytecode_parse_treet & operator()(const irep_idt &)
std::map< irep_idt, jar_map_entryt > jar_mapt
void read_jar_file(java_class_loader_limitt &, const irep_idt &)
std::string java_cp_include_files
limit class path loading
static std::string class_name_to_file(const irep_idt &)
std::map< irep_idt, entryt > entriest