19
19
20
20
#include < java_bytecode/java_bytecode_language.h>
21
21
22
- // / Go through the process of loading, typechecking and finalising loading a
22
+ // / Go through the process of loading, type-checking and finalising loading a
23
23
// / specific class file to build the symbol table.
24
24
// / \param java_class_name: The name of the class file to load. It should not
25
25
// / include the .class extension.
26
26
// / \param class_path: The path to load the class from. Should be relative to
27
27
// / the unit directory.
28
+ // / \param main: The name of the main function or "" to use the default
29
+ // / behaviour to find a main function.
28
30
// / \return The symbol table that is generated by parsing this file.
29
31
symbol_tablet load_java_class (
30
32
const std::string &java_class_name,
31
- const std::string &class_path)
33
+ const std::string &class_path,
34
+ const std::string &main)
32
35
{
33
36
return load_java_class (
34
- java_class_name, class_path, new_java_bytecode_language ());
37
+ java_class_name, class_path, main, new_java_bytecode_language ());
35
38
}
36
39
40
+ // / Go through the process of loading, type-checking and finalising loading a
41
+ // / specific class file to build the symbol table.
42
+ // / \param java_class_name: The name of the class file to load. It should not
43
+ // / include the .class extension.
44
+ // / \param class_path: The path to load the class from. Should be relative to
45
+ // / the unit directory.
46
+ // / \param main: The name of the main function or "" to use the default
47
+ // / behaviour to find a main function.
48
+ // / \param java_lang: The language implementation to use for the loading,
49
+ // / which will be destroyed by this function.
50
+ // / \return The symbol table that is generated by parsing this file.
37
51
symbol_tablet load_java_class (
38
52
const std::string &java_class_name,
39
53
const std::string &class_path,
54
+ const std::string &main,
40
55
std::unique_ptr<languaget> &&java_lang)
41
56
{
42
57
// We expect the name of the class without the .class suffix to allow us to
@@ -58,6 +73,7 @@ symbol_tablet load_java_class(
58
73
command_line.set (" java-cp-include-files" , class_path);
59
74
config.java .classpath .clear ();
60
75
config.java .classpath .push_back (class_path);
76
+ config.main = main;
61
77
62
78
// Add the language to the model
63
79
language_filet &lf=lazy_goto_model.add_language_file (filename);
0 commit comments