replicode
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
r_comp::Compiler Class Reference

#include <compiler.h>

Collaboration diagram for r_comp::Compiler:
Collaboration graph

Classes

class  State
 

Public Member Functions

 Compiler ()
 
bool compile (RepliStruct *rootNode, r_comp::Image *_image, r_comp::Metadata *_metadata, std::string &error, bool trace)
 
std::string getError ()
 
bool read_any (RepliStruct *node, bool enforce, const Class *p, uint16_t write_index, uint16_t &extent_index, bool write)
 
bool read_number (RepliStruct *node, bool enforce, const Class *p, uint16_t write_index, uint16_t &extent_index, bool write)
 
bool read_timestamp (RepliStruct *node, bool enforce, const Class *p, uint16_t write_index, uint16_t &extent_index, bool write)
 
bool read_boolean (RepliStruct *node, bool enforce, const Class *p, uint16_t write_index, uint16_t &extent_index, bool write)
 
bool read_string (RepliStruct *node, bool enforce, const Class *p, uint16_t write_index, uint16_t &extent_index, bool write)
 
bool read_node (RepliStruct *node, bool enforce, const Class *p, uint16_t write_index, uint16_t &extent_index, bool write)
 
bool read_device (RepliStruct *node, bool enforce, const Class *p, uint16_t write_index, uint16_t &extent_index, bool write)
 
bool read_function (RepliStruct *node, bool enforce, const Class *p, uint16_t write_index, uint16_t &extent_index, bool write)
 
bool read_expression (RepliStruct *node, bool enforce, const Class *p, uint16_t write_index, uint16_t &extent_index, bool write)
 
bool read_set (RepliStruct *node, bool enforce, const Class *p, uint16_t write_index, uint16_t &extent_index, bool write)
 
bool read_class (RepliStruct *node, bool enforce, const Class *p, uint16_t write_index, uint16_t &extent_index, bool write)
 
std::string getObjectName (const uint16_t index) const
 

Private Member Functions

State save_state ()
 
void restore_state (State s)
 
void set_error (const std::string &s, RepliStruct *node)
 
void set_arity_error (RepliStruct *node, uint16_t expected, uint16_t got)
 
bool addLocalReference (const std::string reference_name, const uint16_t index, const Class &p)
 
bool getGlobalReferenceIndex (const std::string reference_name, const ReturnType t, ImageObject *object, uint16_t &index, Class *&_class)
 
uint32_t add_hlp_reference (std::string reference_name)
 
uint8_t get_hlp_reference (std::string reference_name)
 
bool read_nil (RepliStruct *node, uint16_t write_index, uint16_t &extent_index, bool write)
 
bool read_nil_set (RepliStruct *node, uint16_t write_index, uint16_t &extent_index, bool write)
 
bool read_nil_nb (RepliStruct *node, uint16_t write_index, uint16_t &extent_index, bool write)
 
bool read_nil_us (RepliStruct *node, uint16_t write_index, uint16_t &extent_index, bool write)
 
bool read_forever_nb (RepliStruct *node, uint16_t write_index, uint16_t &extent_index, bool write)
 
bool read_nil_nid (RepliStruct *node, uint16_t write_index, uint16_t &extent_index, bool write)
 
bool read_nil_did (RepliStruct *node, uint16_t write_index, uint16_t &extent_index, bool write)
 
bool read_nil_fid (RepliStruct *node, uint16_t write_index, uint16_t &extent_index, bool write)
 
bool read_nil_bl (RepliStruct *node, uint16_t write_index, uint16_t &extent_index, bool write)
 
bool read_nil_st (RepliStruct *node, uint16_t write_index, uint16_t &extent_index, bool write)
 
bool read_variable (RepliStruct *node, uint16_t write_index, uint16_t &extent_index, bool write, const Class p)
 
bool read_reference (RepliStruct *node, uint16_t write_index, uint16_t &extent_index, bool write, const ReturnType t)
 
bool read_wildcard (RepliStruct *node, uint16_t write_index, uint16_t &extent_index, bool write)
 
bool read_tail_wildcard (RepliStruct *node, uint16_t write_index, uint16_t &extent_index, bool write)
 
bool local_reference (RepliStruct *node, uint16_t &index, const ReturnType t)
 
bool global_reference (RepliStruct *node, uint16_t &index, const ReturnType t)
 
bool hlp_reference (RepliStruct *node, uint16_t &index)
 
bool this_indirection (RepliStruct *node, std::vector< int16_t > &v, const ReturnType t)
 
bool local_indirection (RepliStruct *node, std::vector< int16_t > &v, const ReturnType t, uint32_t &cast_opcode)
 
bool global_indirection (RepliStruct *node, std::vector< int16_t > &v, const ReturnType t)
 
bool object (RepliStruct *node, Class &p)
 
bool object (RepliStruct *node, const Class &p)
 
bool sys_object (RepliStruct *node, Class &p)
 
bool sys_object (RepliStruct *node, const Class &p)
 
bool marker (RepliStruct *node, Class &p)
 
bool op (RepliStruct *node, Class &p, const ReturnType t)
 
bool op (RepliStruct *node, const Class &p)
 
bool function (RepliStruct *node, Class &p)
 
bool expression_head (RepliStruct *node, Class &p, const ReturnType t)
 
bool expression_head (RepliStruct *node, const Class &p)
 
bool expression_tail (RepliStruct *node, const Class &p, uint16_t write_index, uint16_t &extent_index, bool write)
 
bool expression (RepliStruct *node, const ReturnType t, uint16_t write_index, uint16_t &extent_index, bool write)
 
bool expression (RepliStruct *node, const Class &p, uint16_t write_index, uint16_t &extent_index, bool write)
 
bool set (RepliStruct *node, uint16_t write_index, uint16_t &extent_index, bool write)
 
bool set (RepliStruct *node, const Class &p, uint16_t write_index, uint16_t &extent_index, bool write)
 
bool read (RepliStruct *node, const StructureMember &m, bool enforce, uint16_t write_index, uint16_t &extent_index, bool write)
 
bool read_sys_object (RepliStruct *node, RepliStruct *view)
 

Private Attributes

std::string error
 
std::string m_errorFile
 
int m_errorLine
 
bool trace
 
Class current_class
 
ImageObjectcurrent_object
 
uint64_t current_object_index
 
int64_t current_view_index
 
r_comp::Image_image
 
r_comp::Metadata_metadata
 
State state
 
std::unordered_map< std::string, Referencelocal_references
 labels and variables declared inside objects (cleared before parsing each sys-object): translate to value pointers. More...
 
std::unordered_map< std::string, Referenceglobal_references
 
bool in_hlp
 In high-level pattern. More...
 
std::vector< std::string > hlp_references
 
bool err
 

Constructor & Destructor Documentation

r_comp::Compiler::Compiler ( )

Member Function Documentation

uint32_t r_comp::Compiler::add_hlp_reference ( std::string  reference_name)
private

Here is the caller graph for this function:

bool r_comp::Compiler::addLocalReference ( const std::string  reference_name,
const uint16_t  index,
const Class p 
)
private

Here is the caller graph for this function:

bool r_comp::Compiler::compile ( RepliStruct rootNode,
r_comp::Image _image,
r_comp::Metadata _metadata,
std::string &  error,
bool  trace 
)

Here is the call graph for this function:

bool r_comp::Compiler::expression ( RepliStruct node,
const ReturnType  t,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

bool r_comp::Compiler::expression ( RepliStruct node,
const Class p,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)
private

Here is the call graph for this function:

bool r_comp::Compiler::expression_head ( RepliStruct node,
Class p,
const ReturnType  t 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

bool r_comp::Compiler::expression_head ( RepliStruct node,
const Class p 
)
private

Here is the call graph for this function:

bool r_comp::Compiler::expression_tail ( RepliStruct node,
const Class p,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

bool r_comp::Compiler::function ( RepliStruct node,
Class p 
)
private
uint8_t r_comp::Compiler::get_hlp_reference ( std::string  reference_name)
private

Here is the caller graph for this function:

std::string r_comp::Compiler::getError ( )

Here is the caller graph for this function:

bool r_comp::Compiler::getGlobalReferenceIndex ( const std::string  reference_name,
const ReturnType  t,
ImageObject object,
uint16_t &  index,
Class *&  _class 
)
private

Here is the caller graph for this function:

std::string r_comp::Compiler::getObjectName ( const uint16_t  index) const
bool r_comp::Compiler::global_indirection ( RepliStruct node,
std::vector< int16_t > &  v,
const ReturnType  t 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

bool r_comp::Compiler::global_reference ( RepliStruct node,
uint16_t &  index,
const ReturnType  t 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

bool r_comp::Compiler::hlp_reference ( RepliStruct node,
uint16_t &  index 
)
private

Here is the caller graph for this function:

bool r_comp::Compiler::local_indirection ( RepliStruct node,
std::vector< int16_t > &  v,
const ReturnType  t,
uint32_t &  cast_opcode 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

bool r_comp::Compiler::local_reference ( RepliStruct node,
uint16_t &  index,
const ReturnType  t 
)
private

Here is the caller graph for this function:

bool r_comp::Compiler::marker ( RepliStruct node,
Class p 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

bool r_comp::Compiler::object ( RepliStruct node,
Class p 
)
private

Here is the call graph for this function:

bool r_comp::Compiler::object ( RepliStruct node,
const Class p 
)
private

Here is the call graph for this function:

bool r_comp::Compiler::op ( RepliStruct node,
Class p,
const ReturnType  t 
)
private

Here is the caller graph for this function:

bool r_comp::Compiler::op ( RepliStruct node,
const Class p 
)
private
bool r_comp::Compiler::read ( RepliStruct node,
const StructureMember m,
bool  enforce,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

bool r_comp::Compiler::read_any ( RepliStruct node,
bool  enforce,
const Class p,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)

Here is the call graph for this function:

Here is the caller graph for this function:

bool r_comp::Compiler::read_boolean ( RepliStruct node,
bool  enforce,
const Class p,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)

Here is the call graph for this function:

Here is the caller graph for this function:

bool r_comp::Compiler::read_class ( RepliStruct node,
bool  enforce,
const Class p,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)

Here is the call graph for this function:

Here is the caller graph for this function:

bool r_comp::Compiler::read_device ( RepliStruct node,
bool  enforce,
const Class p,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)

Here is the call graph for this function:

Here is the caller graph for this function:

bool r_comp::Compiler::read_expression ( RepliStruct node,
bool  enforce,
const Class p,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)

Here is the call graph for this function:

Here is the caller graph for this function:

bool r_comp::Compiler::read_forever_nb ( RepliStruct node,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)
private

Here is the caller graph for this function:

bool r_comp::Compiler::read_function ( RepliStruct node,
bool  enforce,
const Class p,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)

Here is the call graph for this function:

Here is the caller graph for this function:

bool r_comp::Compiler::read_nil ( RepliStruct node,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)
private

Here is the caller graph for this function:

bool r_comp::Compiler::read_nil_bl ( RepliStruct node,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)
private

Here is the caller graph for this function:

bool r_comp::Compiler::read_nil_did ( RepliStruct node,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)
private

Here is the caller graph for this function:

bool r_comp::Compiler::read_nil_fid ( RepliStruct node,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)
private

Here is the caller graph for this function:

bool r_comp::Compiler::read_nil_nb ( RepliStruct node,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)
private

Here is the caller graph for this function:

bool r_comp::Compiler::read_nil_nid ( RepliStruct node,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)
private

Here is the caller graph for this function:

bool r_comp::Compiler::read_nil_set ( RepliStruct node,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)
private

Here is the caller graph for this function:

bool r_comp::Compiler::read_nil_st ( RepliStruct node,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)
private

Here is the caller graph for this function:

bool r_comp::Compiler::read_nil_us ( RepliStruct node,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)
private

Here is the caller graph for this function:

bool r_comp::Compiler::read_node ( RepliStruct node,
bool  enforce,
const Class p,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)

Here is the call graph for this function:

Here is the caller graph for this function:

bool r_comp::Compiler::read_number ( RepliStruct node,
bool  enforce,
const Class p,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)

Here is the call graph for this function:

Here is the caller graph for this function:

bool r_comp::Compiler::read_reference ( RepliStruct node,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write,
const ReturnType  t 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

bool r_comp::Compiler::read_set ( RepliStruct node,
bool  enforce,
const Class p,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)

Here is the call graph for this function:

Here is the caller graph for this function:

bool r_comp::Compiler::read_string ( RepliStruct node,
bool  enforce,
const Class p,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)

Here is the call graph for this function:

Here is the caller graph for this function:

bool r_comp::Compiler::read_sys_object ( RepliStruct node,
RepliStruct view 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

bool r_comp::Compiler::read_tail_wildcard ( RepliStruct node,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

bool r_comp::Compiler::read_timestamp ( RepliStruct node,
bool  enforce,
const Class p,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)

Here is the call graph for this function:

Here is the caller graph for this function:

bool r_comp::Compiler::read_variable ( RepliStruct node,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write,
const Class  p 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

bool r_comp::Compiler::read_wildcard ( RepliStruct node,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void r_comp::Compiler::restore_state ( State  s)
private

Here is the caller graph for this function:

Compiler::State r_comp::Compiler::save_state ( )
private

Here is the caller graph for this function:

bool r_comp::Compiler::set ( RepliStruct node,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

bool r_comp::Compiler::set ( RepliStruct node,
const Class p,
uint16_t  write_index,
uint16_t &  extent_index,
bool  write 
)
private

Here is the call graph for this function:

void r_comp::Compiler::set_arity_error ( RepliStruct node,
uint16_t  expected,
uint16_t  got 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void r_comp::Compiler::set_error ( const std::string &  s,
RepliStruct node 
)
private

Here is the caller graph for this function:

bool r_comp::Compiler::sys_object ( RepliStruct node,
Class p 
)
private

Here is the caller graph for this function:

bool r_comp::Compiler::sys_object ( RepliStruct node,
const Class p 
)
private
bool r_comp::Compiler::this_indirection ( RepliStruct node,
std::vector< int16_t > &  v,
const ReturnType  t 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

r_comp::Image* r_comp::Compiler::_image
private
r_comp::Metadata* r_comp::Compiler::_metadata
private
Class r_comp::Compiler::current_class
private
ImageObject* r_comp::Compiler::current_object
private
uint64_t r_comp::Compiler::current_object_index
private
int64_t r_comp::Compiler::current_view_index
private
bool r_comp::Compiler::err
private
std::string r_comp::Compiler::error
private
std::unordered_map<std::string, Reference> r_comp::Compiler::global_references
private
std::vector<std::string> r_comp::Compiler::hlp_references
private
bool r_comp::Compiler::in_hlp
private

In high-level pattern.

std::unordered_map<std::string, Reference> r_comp::Compiler::local_references
private

labels and variables declared inside objects (cleared before parsing each sys-object): translate to value pointers.

std::string r_comp::Compiler::m_errorFile
private
int r_comp::Compiler::m_errorLine
private
State r_comp::Compiler::state
private
bool r_comp::Compiler::trace
private

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