ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
jimple_file Class Reference

Main AST for Class/Interface. More...

#include <jimple_file.h>

Inheritance diagram for jimple_file:
[legend]

Public Types

enum class  file_type { Class , Interface }

Public Member Functions

virtual void from_json (const json &j) override
 Initializes the current instance by parsing a JSON.
virtual std::string to_string () const override
 Converts the object into a string.
void load_file (const std::string &path)
 initializes the object with a file
file_type from_string (const std::string &name) const
std::string to_string (const file_type &ft) const
virtual exprt to_exprt (contextt &ctx) const
 convert the object into a exprt
bool is_interface () const
Public Member Functions inherited from jimple_ast
void dump () const
 Prints the contents into the the stdout.

Public Attributes

file_type mode
std::string class_name
std::string extends
std::string implements
jimple_modifiers modifiers
std::vector< std::shared_ptr< jimple_class_member > > body
Public Attributes inherited from jimple_ast
int line_location = -1
 instruction location

Additional Inherited Members

Static Protected Member Functions inherited from jimple_ast
static symbolt create_jimple_symbolt (const type2tc &t, const std::string &module, const std::string &name, const std::string &id, const std::string function_name="")
 creates a symbol with the default characteristics
static symbolt get_temp_symbol (const type2tc &t, const std::string &class_name, const std::string &function_name)
 Create a temporary variable to be used.
static symbolt get_allocation_function ()
 Get the allocation function symbol.
static symbolt get_lengthof_function ()
 Get the esbmc_get_object_size symbol.
static std::string get_method_name (std::string class_name, std::string function_name)
 Get the unique method name.
static std::string get_symbol_name (std::string class_name, std::string function_name, std::string symbol)
 Get the symbol name id.
static locationt get_location (const std::string &module, const std::string function_name="")
 initialize a location for the symbol

Detailed Description

Main AST for Class/Interface.

Every Jimple file contains at most one Class/Interface, this class will represent this.

The file can:

  • extend (or implement) another Class/Interface
  • contain modifiers: public/private/static/etc... (see jimple_modifiers.hpp)
  • contain methods and attributes.

Notes:

  • Java/Kotlin have support for inner classes. When compiled into bytecode each class has its own .class file. For example, an inner class Bar inside the Foo class will generate both Foo.class and Foo$Bar.class.

Member Enumeration Documentation

◆ file_type

Enumerator
Class 
Interface 

Member Function Documentation

◆ from_json()

void jimple_file::from_json ( const json & )
overridevirtual

Initializes the current instance by parsing a JSON.

Parameters
jsonThe json object relative to the structure

Implements jimple_ast.

◆ from_string()

jimple_file::file_type jimple_file::from_string ( const std::string & name) const
inline

◆ is_interface()

bool jimple_file::is_interface ( ) const
inline

◆ load_file()

void jimple_file::load_file ( const std::string & path)

initializes the object with a file

Parameters
pathA path to a .jimple file

◆ to_exprt()

exprt jimple_file::to_exprt ( contextt & ctx) const
virtual

convert the object into a exprt

◆ to_string() [1/2]

std::string jimple_file::to_string ( ) const
overridevirtual

Converts the object into a string.

Returns
a human readable string of the object

Implements jimple_ast.

◆ to_string() [2/2]

std::string jimple_file::to_string ( const file_type & ft) const
inline

Member Data Documentation

◆ body

std::vector<std::shared_ptr<jimple_class_member> > jimple_file::body

◆ class_name

std::string jimple_file::class_name

◆ extends

std::string jimple_file::extends

◆ implements

std::string jimple_file::implements

◆ mode

file_type jimple_file::mode

◆ modifiers

jimple_modifiers jimple_file::modifiers

The documentation for this class was generated from the following files: