Skip to content

Module

INCLUDE FILE
#include "Module.h"

class Module

DEFINITION
class Module;

class Pinnedprivate

DEFINITION
class Pinned;

constructor Pinned

DEFINITION
Pinned ( );

constructor Pinned

DEFINITION
Pinned ( Symbol  object_name,
Expression  address );
PARAMETERDESCRIPTION
object_name
address

method evaluate

DEFINITION
void  evaluate ( EvaluationContext  context );
PARAMETERDESCRIPTION
context

method resolve

DEFINITION
void  resolve ( Scope & scope );
PARAMETERDESCRIPTION
scope

member address

DEFINITION
Expression  address;

member object_name

DEFINITION
Symbol  object_name;

constructor Module

DEFINITION
Module ( );

constructor Module

DEFINITION
Module ( Symbol  name );
PARAMETERDESCRIPTION
name

method add_entity

DEFINITION
void  add_entity ( std::shared_ptr< Entity >  entity,
std::shared_ptr< Scope >  current_file_scope );
PARAMETERDESCRIPTION
entity
current_file_scope

method add_file

Add a file to the module.

DEFINITION
std::shared_ptr< Scope >  add_file ( Symbol  file_name );
PARAMETERDESCRIPTION
file_name

The name of the file.

RETURNSDESCRIPTION
std::shared_ptr< Scope >

The file scope of the new file.

method constantsconst

Get all constants defined in the module.

DEFINITION
std::vector< Constant * >  constants ( ) const;
RETURNSDESCRIPTION
std::vector< Constant * >

A map of constant names to their values.

method entitiesconst

Get all entities defined in the module.

DEFINITION
std::vector< Entity * >  entities ( ) const;
RETURNSDESCRIPTION
std::vector< Entity * >

A vector of entities.

method explicitly_used_entitiesconst

DEFINITION
std::vector< Entity * >  explicitly_used_entities ( ) const;
RETURNSDESCRIPTION
std::vector< Entity * >

method file_scopeconst

Get the file scope for a specific file.

DEFINITION
std::shared_ptr< Scope >  file_scope ( Symbol  file_name ) const;
PARAMETERDESCRIPTION
file_name

The name of the file.

RETURNSDESCRIPTION
std::shared_ptr< Scope >

The file scope.

method functionsconst

Get all functions defined in the module.

DEFINITION
std::vector< Function * >  functions ( ) const;
RETURNSDESCRIPTION
std::vector< Function * >

A vector of functions.

method get_entitiesconst

DEFINITION
template <typename T>
std::vector< T * >  get_entities ( ) const;
RETURNSDESCRIPTION
std::vector< T * >

method import

Import a module.

DEFINITION
void  import ( Visibility  visibility,
const Module & module );
PARAMETERDESCRIPTION
visibility

The visibility of the imported symbols.

module

The module to import.

method imported_modulesconst

DEFINITION
const std::unordered_set< Module * > & imported_modules ( Visibility  visibility ) const;
PARAMETERDESCRIPTION
visibility
RETURNSDESCRIPTION
const std::unordered_set< Module * > &

method macrosconst

Get all macros defined in the module.

DEFINITION
std::vector< Macro * >  macros ( ) const;
RETURNSDESCRIPTION
std::vector< Macro * >

A vector of macros.

method nameconst

DEFINITION
Symbol  name ( ) const;
RETURNSDESCRIPTION
Symbol

method objectsconst

Get all objects defined in the module.

DEFINITION
std::vector< Object * >  objects ( ) const;
RETURNSDESCRIPTION
std::vector< Object * >

A vector of objects.

method private_scopeconst

Get the module's private scope.

DEFINITION
std::shared_ptr< Scope >  private_scope ( ) const;
RETURNSDESCRIPTION
std::shared_ptr< Scope >

The private scope.

method public_scopeconst

Get the module's public scope.

DEFINITION
std::shared_ptr< Scope >  public_scope ( ) const;
RETURNSDESCRIPTION
std::shared_ptr< Scope >

The public scope.

method rename

DEFINITION
void  rename ( Symbol  new_name );
PARAMETERDESCRIPTION
new_name

method resolve

Resolve names and expressions in the module.

This function does not resolve the contained entities.

DEFINITION
void  resolve ( );

member contained_entitiesprivate

DEFINITION
std::unordered_set< std::shared_ptr< Entity > >  contained_entities;

member file_scopesprivate

DEFINITION
std::unordered_map< Symbol, std::shared_ptr< Scope > >  file_scopes;

member imported_modules_private

DEFINITION
std::unordered_map< Visibility, std::unordered_set< Module * > >  imported_modules_;

member name_private

The name of the module.

DEFINITION
Symbol  name_;

member no_modulesstatic private

DEFINITION
static std::unordered_set< Module * >  no_modules;

member private_scope_private

The private scope of the module.

DEFINITION
std::shared_ptr< Scope >  private_scope_;

member public_scope_private

The public scope of the module.

DEFINITION
std::shared_ptr< Scope >  public_scope_;

member target

The target of the module.

DEFINITION
Target * target;

class Pinnedprivate

DEFINITION
class Pinned;

constructor Pinned

DEFINITION
Pinned ( );

constructor Pinned

DEFINITION
Pinned ( Symbol  object_name,
Expression  address );
PARAMETERDESCRIPTION
object_name
address

method evaluate

DEFINITION
void  evaluate ( EvaluationContext  context );
PARAMETERDESCRIPTION
context

method resolve

DEFINITION
void  resolve ( Scope & scope );
PARAMETERDESCRIPTION
scope

member address

DEFINITION
Expression  address;

member object_name

DEFINITION
Symbol  object_name;