35 const std::string &java_class_name,
36 const std::string &class_path,
37 const std::string &
main)
47 const std::string &java_class_name,
48 const std::string &class_path,
49 const std::string &
main)
57 const std::string &java_class_name,
58 const std::string &class_path,
59 const std::string &
main,
60 std::unique_ptr<languaget> &&java_lang,
87 const std::string &java_class_name,
88 const std::string &class_path,
89 const std::string &
main,
90 std::unique_ptr<languaget> &&java_lang,
96 std::string filename=java_class_name +
".class";
102 [](
const irep_idt &) {
return false; },
120 std::istringstream java_code_stream(
"ignored");
131 language.
final(lazy_goto_model.symbol_table);
133 lazy_goto_model.load_all_functions();
135 std::unique_ptr<goto_modelt> maybe_goto_model=
137 std::move(lazy_goto_model));
138 INVARIANT(maybe_goto_model,
"Freezing lazy_goto_model failed");
141 const std::string class_symbol_name=
"java::"+java_class_name;
142 REQUIRE(maybe_goto_model->symbol_table.has_symbol(class_symbol_name));
144 *maybe_goto_model->symbol_table.lookup(class_symbol_name);
146 const typet &class_type=class_symbol.
type;
147 REQUIRE(class_type.
id()==ID_struct);
152 std::string path = std::filesystem::current_path().string();
153 INFO(
"Working directory: " << path);
159 return std::move(*maybe_goto_model);
166 const std::string &java_class_name,
167 const std::string &class_path,
168 const std::string &
main,
169 std::unique_ptr<languaget> &&java_lang)
172 command_line.
add_flag(
"no-lazy-methods");
174 java_class_name, class_path,
main, std::move(java_lang), command_line);
178 const std::string &java_class_name,
179 const std::string &class_path,
180 const std::vector<std::string> &command_line_flags,
181 const std::unordered_map<std::string, std::string> &command_line_options,
182 const std::string &
main)
185 for(
const auto &flag : command_line_flags)
187 for(
const auto &option : command_line_options)
188 command_line.
add_option(option.first, option.second);
193 java_class_name, class_path,
main, std::move(lang), command_line);
200 const std::string &java_class_name,
201 const std::string &class_path,
202 const std::string &
main)
205 java_class_name, class_path, {
"no-lazy-methods"}, {},
main);
Abstract interface to eager or lazy GOTO models.
std::optional< std::string > main
struct configt::javat java
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
A goto function, consisting of function body (see body) and parameter identifiers (see parameter_iden...
Interface providing access to a single function in a GOTO model, plus its associated symbol table.
const symbol_tablet & get_symbol_table() const override
Accessor to get the symbol table.
const irep_idt & id() const
virtual bool final(symbol_table_baset &context) override
Final adjustments, e.g.
void set_language_options(const optionst &, message_handlert &) override
Consume options that are java bytecode specific.
bool typecheck(symbol_table_baset &context, const std::string &module, message_handlert &message_handler) override
bool generate_support_functions(symbol_table_baset &symbol_table, message_handlert &message_handler) override
Create language-specific support functions, such as __CPROVER_start, __CPROVER_initialize and languag...
bool parse(std::istream &instream, const std::string &path, message_handlert &message_handler) override
We set the main class (i.e. class to start the class loading analysis, see java_class_loadert) when w...
std::unique_ptr< languaget > language
A GOTO model that produces function bodies on demand.
static std::unique_ptr< goto_modelt > process_whole_model_and_freeze(lazy_goto_modelt &&model)
The model returned here has access to the functions we've already loaded but is frozen in the sense t...
The symbol table base class interface.
typet type
Type of symbol.
The type of an expression, extends irept.
int main(int argc, char *argv[])
void parse_java_language_options(const cmdlinet &cmd, optionst &options)
Parse options that are java bytecode specific.
std::unique_ptr< languaget > new_java_bytecode_language()
const java_class_typet & to_java_class_type(const typet &type)
symbol_tablet load_java_class(const std::string &java_class_name, const std::string &class_path, const std::string &main)
Returns the symbol table from load_goto_model_from_java_class(const std::string &java_class_name,...
symbol_tablet load_java_class_lazy(const std::string &java_class_name, const std::string &class_path, const std::string &main)
Go through the process of loading, type-checking and finalising loading a specific class file to buil...
goto_modelt load_goto_model_from_java_class(const std::string &java_class_name, const std::string &class_path, const std::string &main, std::unique_ptr< languaget > &&java_lang, const cmdlinet &command_line)
Go through the process of loading, type-checking and finalising a specific class file to build a goto...
Utility for loading and parsing a specified java class file, returning the symbol table generated by ...
#define PRECONDITION(CONDITION)
#define INVARIANT(CONDITION, REASON)
This macro uses the wrapper function 'invariant_violated_string'.
bool has_suffix(const std::string &s, const std::string &suffix)
null_message_handlert null_message_handler