replicode
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
r_comp::Decompiler Class Reference

#include <decompiler.h>

Collaboration diagram for r_comp::Decompiler:
Collaboration graph

Public Member Functions

 Decompiler ()
 
 ~Decompiler ()
 
void init (r_comp::Metadata *metadata)
 
uint64_t decompile (r_comp::Image *image, std::ostringstream *stream, uint64_t time_offset, bool ignore_named_objects)
 
uint64_t decompile (r_comp::Image *image, std::ostringstream *stream, uint64_t time_offset, std::vector< SysObject * > &imported_objects)
 
uint64_t decompile_references (r_comp::Image *image)
 
void decompile_object (uint16_t object_index, std::ostringstream *stream, uint64_t time_offset)
 
void decompile_object (const std::string object_name, std::ostringstream *stream, uint64_t time_offset)
 

Private Types

typedef void(Decompiler::* Renderer) (uint16_t)
 

Private Member Functions

std::string get_variable_name (uint16_t index, bool postfix)
 
std::string get_hlp_variable_name (uint16_t index)
 
std::string get_object_name (uint16_t index)
 
void write_indent (uint16_t i)
 
void write_expression_head (uint16_t read_index)
 
void write_expression_tail (uint16_t read_index, bool apply_time_offset, bool vertical=false)
 
void write_set (uint16_t read_index, bool aply_time_offset, uint16_t write_as_view_index=0)
 
void write_any (uint16_t read_index, bool &after_tail_wildcard, bool apply_time_offset, uint16_t write_as_view_index=0)
 
void write_expression (uint16_t read_index)
 
void write_group (uint16_t read_index)
 
void write_marker (uint16_t read_index)
 
void write_pgm (uint16_t read_index)
 
void write_ipgm (uint16_t read_index)
 
void write_icmd (uint16_t read_index)
 
void write_cmd (uint16_t read_index)
 
void write_fact (uint16_t read_index)
 
void write_hlp (uint16_t read_index)
 
void write_ihlp (uint16_t read_index)
 
void write_view (uint16_t read_index, uint16_t arity)
 

Private Attributes

OutStreamout_stream
 
uint16_t indents
 
bool closing_set
 
bool in_hlp
 
bool hlp_postfix
 
bool horizontal_set
 
ImageObjectcurrent_object
 
r_comp::Metadatametadata
 
r_comp::Imageimage
 
uint64_t time_offset
 
std::unordered_map< uint16_t, std::string > variable_names
 
uint16_t last_variable_id
 
std::unordered_map< uint16_t, std::string > object_names
 
std::unordered_map< std::string, uint16_t > object_indices
 
r_code::vector< Rendererrenderers
 
bool partial_decompilation
 
bool ignore_named_objects
 
std::unordered_set< uint16_t > named_objects
 
std::vector< SysObject * > imported_objects
 

Member Typedef Documentation

typedef void(Decompiler::* r_comp::Decompiler::Renderer) (uint16_t)
private

Constructor & Destructor Documentation

r_comp::Decompiler::Decompiler ( )
r_comp::Decompiler::~Decompiler ( )

Member Function Documentation

uint64_t r_comp::Decompiler::decompile ( r_comp::Image image,
std::ostringstream *  stream,
uint64_t  time_offset,
bool  ignore_named_objects 
)

Here is the call graph for this function:

Here is the caller graph for this function:

uint64_t r_comp::Decompiler::decompile ( r_comp::Image image,
std::ostringstream *  stream,
uint64_t  time_offset,
std::vector< SysObject * > &  imported_objects 
)

Here is the call graph for this function:

void r_comp::Decompiler::decompile_object ( uint16_t  object_index,
std::ostringstream *  stream,
uint64_t  time_offset 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void r_comp::Decompiler::decompile_object ( const std::string  object_name,
std::ostringstream *  stream,
uint64_t  time_offset 
)

Here is the call graph for this function:

uint64_t r_comp::Decompiler::decompile_references ( r_comp::Image image)

Here is the call graph for this function:

Here is the caller graph for this function:

std::string r_comp::Decompiler::get_hlp_variable_name ( uint16_t  index)
private

Here is the caller graph for this function:

std::string r_comp::Decompiler::get_object_name ( uint16_t  index)
private

Here is the caller graph for this function:

std::string r_comp::Decompiler::get_variable_name ( uint16_t  index,
bool  postfix 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void r_comp::Decompiler::init ( r_comp::Metadata metadata)

Here is the call graph for this function:

Here is the caller graph for this function:

void r_comp::Decompiler::write_any ( uint16_t  read_index,
bool &  after_tail_wildcard,
bool  apply_time_offset,
uint16_t  write_as_view_index = 0 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void r_comp::Decompiler::write_cmd ( uint16_t  read_index)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void r_comp::Decompiler::write_expression ( uint16_t  read_index)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void r_comp::Decompiler::write_expression_head ( uint16_t  read_index)
private

Here is the caller graph for this function:

void r_comp::Decompiler::write_expression_tail ( uint16_t  read_index,
bool  apply_time_offset,
bool  vertical = false 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void r_comp::Decompiler::write_fact ( uint16_t  read_index)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void r_comp::Decompiler::write_group ( uint16_t  read_index)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void r_comp::Decompiler::write_hlp ( uint16_t  read_index)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void r_comp::Decompiler::write_icmd ( uint16_t  read_index)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void r_comp::Decompiler::write_ihlp ( uint16_t  read_index)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void r_comp::Decompiler::write_indent ( uint16_t  i)
private

Here is the caller graph for this function:

void r_comp::Decompiler::write_ipgm ( uint16_t  read_index)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void r_comp::Decompiler::write_marker ( uint16_t  read_index)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void r_comp::Decompiler::write_pgm ( uint16_t  read_index)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void r_comp::Decompiler::write_set ( uint16_t  read_index,
bool  aply_time_offset,
uint16_t  write_as_view_index = 0 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void r_comp::Decompiler::write_view ( uint16_t  read_index,
uint16_t  arity 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

bool r_comp::Decompiler::closing_set
private
ImageObject* r_comp::Decompiler::current_object
private
bool r_comp::Decompiler::hlp_postfix
private
bool r_comp::Decompiler::horizontal_set
private
bool r_comp::Decompiler::ignore_named_objects
private
r_comp::Image* r_comp::Decompiler::image
private
std::vector<SysObject *> r_comp::Decompiler::imported_objects
private
bool r_comp::Decompiler::in_hlp
private
uint16_t r_comp::Decompiler::indents
private
uint16_t r_comp::Decompiler::last_variable_id
private
r_comp::Metadata* r_comp::Decompiler::metadata
private
std::unordered_set<uint16_t> r_comp::Decompiler::named_objects
private
std::unordered_map<std::string, uint16_t> r_comp::Decompiler::object_indices
private
std::unordered_map<uint16_t, std::string> r_comp::Decompiler::object_names
private
OutStream* r_comp::Decompiler::out_stream
private
bool r_comp::Decompiler::partial_decompilation
private
r_code::vector<Renderer> r_comp::Decompiler::renderers
private
uint64_t r_comp::Decompiler::time_offset
private
std::unordered_map<uint16_t, std::string> r_comp::Decompiler::variable_names
private

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