Skip to content

Scope

INCLUDE FILE
#include "Scope.h"

class Scope

Represents a scope used for name resolution. It can be contained in other scopes.

Lookups search all containing scopes going outwards.

DEFINITION
class Scope;

class AllCollections

DEFINITION
class AllCollections;

class Iterator

DEFINITION
class Iterator;
constructor Iterator
DEFINITION
Iterator ( const Scope * scope,
std::unordered_map< Symbol, std::weak_ptr< Constant > >::const_iterator  constant_it,
std::unordered_map< Symbol, std::weak_ptr< Function > >::const_iterator  function_it,
std::unordered_map< Symbol, std::weak_ptr< Macro > >::const_iterator  macro_it,
std::unordered_map< Symbol, std::weak_ptr< Object > >::const_iterator  object_it );
PARAMETERDESCRIPTION
scope
constant_it
function_it
macro_it
object_it
method operator!=const
DEFINITION
bool  operator!= ( const Iterator & other ) const;
PARAMETERDESCRIPTION
other
RETURNSDESCRIPTION
bool
method operator*const
DEFINITION
value_type  operator* ( ) const;
RETURNSDESCRIPTION
value_type
method operator++
DEFINITION
Iterator & operator++ ( );
RETURNSDESCRIPTION
Iterator &
method operator++
DEFINITION
Iterator  operator++ ( int  );
PARAMETERDESCRIPTION
RETURNSDESCRIPTION
Iterator
method operator==const
DEFINITION
bool  operator== ( const Iterator & other ) const;
PARAMETERDESCRIPTION
other
RETURNSDESCRIPTION
bool
member constant_itprivate
DEFINITION
std::unordered_map< Symbol, std::weak_ptr< Constant > >::const_iterator  constant_it;
member function_itprivate
DEFINITION
std::unordered_map< Symbol, std::weak_ptr< Function > >::const_iterator  function_it;
member macro_itprivate
DEFINITION
std::unordered_map< Symbol, std::weak_ptr< Macro > >::const_iterator  macro_it;
member object_itprivate
DEFINITION
std::unordered_map< Symbol, std::weak_ptr< Object > >::const_iterator  object_it;
member scopeprivate
DEFINITION
const Scope * scope;

constructor AllCollections

DEFINITION
AllCollections ( const Scope * scope );
PARAMETERDESCRIPTION
scope

method beginconst

DEFINITION
Iterator  begin ( ) const;
RETURNSDESCRIPTION
Iterator

method endconst

DEFINITION
Iterator  end ( ) const;
RETURNSDESCRIPTION
Iterator

member scopeprivate

DEFINITION
const Scope * scope;

class Collection

Represents an unordered collection of entities in the scope.

It provides an iterator to iterate over the elements in the collection.

DEFINITION
template <typename T> class Collection;

class Iterator

Iterator for the collection.

DEFINITION
class Iterator;
constructor Iterator

Initialize the iterator with the given unordered map iterator.

DEFINITION
Iterator ( std::unordered_map< Symbol, std::weak_ptr< T > >::const_iterator  it );
PARAMETERDESCRIPTION
it

The unordered map iterator.

method operator!=const

Check if the iterator is not equal to another iterator.

DEFINITION
bool  operator!= ( const Iterator & other ) const;
PARAMETERDESCRIPTION
other

The other iterator to compare with.

RETURNSDESCRIPTION
bool

true if the iterators are not equal, false otherwise.

method operator*const

Dereference the iterator.

DEFINITION
value_type  operator* ( ) const;
RETURNSDESCRIPTION
value_type

The entity pointed to by the iterator.

method operator++

Pre-increment the iterator.

DEFINITION
Iterator & operator++ ( );
RETURNSDESCRIPTION
Iterator &

The incremented iterator.

method operator++

Post-increment the iterator.

DEFINITION
Iterator  operator++ ( int  );
PARAMETERDESCRIPTION
RETURNSDESCRIPTION
Iterator

The iterator before incrementing.

method operator->const

Get the pointer to the entity pointed to by the iterator.

DEFINITION
pointer  operator-> ( ) const;
RETURNSDESCRIPTION
pointer

The pointer to the entity.

method operator==const

Check if the iterator is equal to another iterator.

DEFINITION
bool  operator== ( const Iterator & other ) const;
PARAMETERDESCRIPTION
other

The other iterator to compare with.

RETURNSDESCRIPTION
bool

true if the iterators are equal, false otherwise.

member itprivate

The underlying unordered map iterator.

DEFINITION
std::unordered_map< Symbol, std::weak_ptr< T > >::const_iterator  it;

constructor Collection

Initialize the collection with the given unordered map.

DEFINITION
Collection ( const std::unordered_map< Symbol, std::weak_ptr< T > > & collection );
PARAMETERDESCRIPTION
collection

The unordered map containing the entities.

method beginconst

Get the beginning iterator of the collection.

DEFINITION
Iterator  begin ( ) const;
RETURNSDESCRIPTION
Iterator

The beginning iterator.

method endconst

Get the end iterator of the collection.

DEFINITION
Iterator  end ( ) const;
RETURNSDESCRIPTION
Iterator

The end iterator.

method sizeconst

Get the size of the collection.

DEFINITION
size_t  size ( ) const;
RETURNSDESCRIPTION
size_t

The number of entities in the collection.

member collectionprivate

The underlying unordered map containing the entities.

DEFINITION
const std::unordered_map< Symbol, std::weak_ptr< T > > & collection;

class MarkedUsedprivate

DEFINITION
class MarkedUsed;

constructor MarkedUsed

DEFINITION
MarkedUsed ( Location  location,
Symbol  object_name );
PARAMETERDESCRIPTION
location
object_name

member location

DEFINITION
Location  location;

member object_name

DEFINITION
Symbol  object_name;

class Pinprivate

DEFINITION
class Pin;

constructor Pin

DEFINITION
Pin ( Location  location,
Symbol  object_name,
Address  address,
bool  mark_used );
PARAMETERDESCRIPTION
location
object_name
address
mark_used

member address

DEFINITION
Address  address;

member location

DEFINITION
Location  location;

member mark_used

DEFINITION
bool  mark_used;

member object_name

DEFINITION
Symbol  object_name;

constructor Scope

Constructs a scope not contained in another scope.

DEFINITION
Scope ( Visibility  type,
Symbol  name = {} );
PARAMETERDESCRIPTION
type

The type of the scope.

name

The name of the scope.

constructor Scope

Constructs a named scope contained in another scope.

DEFINITION
Scope ( Visibility  type,
Symbol  name,
std::shared_ptr< Scope >  next );
PARAMETERDESCRIPTION
type

The type of the scope.

name

The name of the scope.

next

The next scope.

constructor Scope

Construct an unnamed scope contained in another scope.

DEFINITION
Scope ( Visibility  type,
std::shared_ptr< Scope >  next );
PARAMETERDESCRIPTION
type

The type of the scope.

next

The next scope.

destructor ~Scope

DEFINITION
~Scope ( );

method add

Add a constant to the scope.

DEFINITION
void  add ( std::shared_ptr< Constant >  constant );
PARAMETERDESCRIPTION
constant

The constant to add.

method add

Add a function to the scope.

DEFINITION
void  add ( std::shared_ptr< Function >  function );
PARAMETERDESCRIPTION
function

The function to add.

method add

Add a macro to the scope.

DEFINITION
void  add ( std::shared_ptr< Macro >  macro );
PARAMETERDESCRIPTION
macro

The macro to add.

method add

Add an object to the scope.

DEFINITION
void  add ( std::shared_ptr< Object >  object );
PARAMETERDESCRIPTION
object

The object to add.

method add_entity

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

method add_next

Add a new scope to the list of containing scopes.

DEFINITION
void  add_next ( std::shared_ptr< Scope >  new_next );
PARAMETERDESCRIPTION
new_next

The new scope to add.

method add_precheckprivate

Checks that adding an entity of the given type and name is allowed and find the correct scope to add it to.

If any errors are found, they will be reported via DiagnosticOutput and an exception will be thrown.

DEFINITION
template <typename T>
Scope * add_precheck ( Visibility  visibility,
Symbol  name,
const Location & location );
PARAMETERDESCRIPTION
visibility

The visibility of the entity.

name

The name of the entity.

location

The location of the entity definition in the source code.

RETURNSDESCRIPTION
Scope *

The scope to add the entity to.

THROWSDESCRIPTION
Exception

if adding the entity is not allowed.

method add_unnamed_label

DEFINITION
void  add_unnamed_label ( const Location & location,
Expression  label_expression );
PARAMETERDESCRIPTION
location
label_expression

method can_containstatic private

Determines if a scope of type contained can be contained in a scope of type container.

DEFINITION
static bool  can_contain ( Visibility  container,
Visibility  contained );
PARAMETERDESCRIPTION
container

The type of the containing scope.

contained

The type of the contained scope.

RETURNSDESCRIPTION
bool

true if a scope of type contained can be contained in a scope of type container, false otherwise.

method can_renameconst

DEFINITION
bool  can_rename ( Symbol  new_name ) const;
PARAMETERDESCRIPTION
new_name
RETURNSDESCRIPTION
bool

method define

Define a preprocessor symbol in the scope.

DEFINITION
void  define ( Symbol  name );
PARAMETERDESCRIPTION
name

The name of the symbol.

method define

Define multiple preprocessor symbols in the scope.

DEFINITION
void  define ( const std::unordered_set< Symbol > & names );
PARAMETERDESCRIPTION
names

The names of the symbols.

method find_conflictingprivate

Finds a conflicting entity in the scope.

This is a helper function used in the add_precheck() template function.

Since we cannot fully declare the entity classes here (they contain a Scope), we use specific functions for each entity type that are defined in the .cc file.

DEFINITION
template <typename T>
const std::optional< Location >  find_conflicting ( Symbol  name,
Visibility  visibility );
PARAMETERDESCRIPTION
name

The name of the entity.

visibility
RETURNSDESCRIPTION
const std::optional< Location >

The location of the conflicting entity, or {} if no conflict exists.

method find_conflictingprivate

DEFINITION
const std::optional< Location >  find_conflicting ( Symbol  name,
Visibility  visibility );
PARAMETERDESCRIPTION
name
visibility
RETURNSDESCRIPTION
const std::optional< Location >

method find_conflictingprivate

DEFINITION
const std::optional< Location >  find_conflicting ( Symbol  name,
Visibility  visibility );
PARAMETERDESCRIPTION
name
visibility
RETURNSDESCRIPTION
const std::optional< Location >

method find_conflictingprivate

DEFINITION
const std::optional< Location >  find_conflicting ( Symbol  name,
Visibility  visibility );
PARAMETERDESCRIPTION
name
visibility
RETURNSDESCRIPTION
const std::optional< Location >

method find_conflictingprivate

DEFINITION
const std::optional< Location >  find_conflicting ( Symbol  name,
Visibility  visibility );
PARAMETERDESCRIPTION
name
visibility
RETURNSDESCRIPTION
const std::optional< Location >

method find_conflicting_constant_or_objectprivate

DEFINITION
std::optional< Location >  find_conflicting_constant_or_object ( Symbol  name,
Visibility  visibility );
PARAMETERDESCRIPTION
name
visibility
RETURNSDESCRIPTION
std::optional< Location >

method find_conflicting_functionprivate

DEFINITION
std::optional< Location >  find_conflicting_function ( Symbol  name );
PARAMETERDESCRIPTION
name
RETURNSDESCRIPTION
std::optional< Location >

method find_conflicting_macroprivate

DEFINITION
std::optional< Location >  find_conflicting_macro ( Symbol  name );
PARAMETERDESCRIPTION
name
RETURNSDESCRIPTION
std::optional< Location >

method find_containing_scopeprivate

Finds the first containing scope of a given visibility.

DEFINITION
Scope * find_containing_scope ( Visibility  visibility );
PARAMETERDESCRIPTION
visibility

The visibility of the containing scope to find.

RETURNSDESCRIPTION
Scope *

The containing scope.

THROWSDESCRIPTION
Exception

if no containing scope of the given visibility is found.

method getconst private

Get an entity from a collection by name.

DEFINITION
template <typename T>
std::shared_ptr< T >  get ( const std::unordered_map< Symbol, std::weak_ptr< T > > & collection,
Symbol  name ) const;
PARAMETERDESCRIPTION
collection

The collection to search.

name

The name of the entity.

RETURNSDESCRIPTION
std::shared_ptr< T >

The entity if found, {} otherwise.

method getconst private

Find an entity of the given type in the scope.

This implements the logic for finding an entity. It is called by the public get functions for each entity type.

DEFINITION
template <typename T>
std::shared_ptr< T >  get ( Symbol  name,
bool  include_containing_scopes = true ) const;
PARAMETERDESCRIPTION
name

The name of the entity.

include_containing_scopes

If true, search in containing scopes as well; if false, only search in this scope.

RETURNSDESCRIPTION
std::shared_ptr< T >

The entity, if found; otherwise, nullptr.

method get_allconst

DEFINITION
template <typename T>
Collection< T >  get_all ( ) const;
RETURNSDESCRIPTION
Collection< T >

method get_allconst

DEFINITION
Collection< Constant >  get_all ( ) const;
RETURNSDESCRIPTION
Collection< Constant >

method get_allconst

DEFINITION
Collection< Function >  get_all ( ) const;
RETURNSDESCRIPTION
Collection< Function >

method get_allconst

DEFINITION
Collection< Macro >  get_all ( ) const;
RETURNSDESCRIPTION
Collection< Macro >

method get_allconst

DEFINITION
Collection< Object >  get_all ( ) const;
RETURNSDESCRIPTION
Collection< Object >

method get_constantconst

Get a constant from the scope.

DEFINITION
std::shared_ptr< Constant >  get_constant ( Symbol  name,
bool  include_containing_scopes = true ) const;
PARAMETERDESCRIPTION
name

The name of the constant.

include_containing_scopes

If true, search in containing scopes as well; if false, only search in this scope.

RETURNSDESCRIPTION
std::shared_ptr< Constant >

The constant if it exists, nullptr otherwise.

method get_constantsconst

Get the constants defined in this scope. It does not include constants defined in containing scopes.

DEFINITION
Collection< Constant >  get_constants ( ) const;
RETURNSDESCRIPTION
Collection< Constant >

A collection of all constants.

method get_definesconst

DEFINITION
const std::unordered_set< Symbol > & get_defines ( ) const;
RETURNSDESCRIPTION
const std::unordered_set< Symbol > &

method get_directlyconst private

Find an entity of a given type defined in this scope, not looking in containing scopes.

This is a helper function used in the get() template function.

DEFINITION
template <typename T>
std::shared_ptr< T >  get_directly ( Symbol  name ) const;
PARAMETERDESCRIPTION
name

The name of the entity.

RETURNSDESCRIPTION
std::shared_ptr< T >

The entity, if found; otherwise, nullptr.

method get_directlyconst private

DEFINITION
std::shared_ptr< Constant >  get_directly ( Symbol  name ) const;
PARAMETERDESCRIPTION
name
RETURNSDESCRIPTION
std::shared_ptr< Constant >

method get_directlyconst private

DEFINITION
std::shared_ptr< Function >  get_directly ( Symbol  name ) const;
PARAMETERDESCRIPTION
name
RETURNSDESCRIPTION
std::shared_ptr< Function >

method get_directlyconst private

DEFINITION
std::shared_ptr< Macro >  get_directly ( Symbol  name ) const;
PARAMETERDESCRIPTION
name
RETURNSDESCRIPTION
std::shared_ptr< Macro >

method get_directlyconst private

DEFINITION
std::shared_ptr< Object >  get_directly ( Symbol  name ) const;
PARAMETERDESCRIPTION
name
RETURNSDESCRIPTION
std::shared_ptr< Object >

method get_entitiesconst

DEFINITION
AllCollections  get_entities ( ) const;
RETURNSDESCRIPTION
AllCollections

method get_functionconst

Get a function from the scope.

DEFINITION
std::shared_ptr< Function >  get_function ( Symbol  name,
bool  include_containing_scopes = true ) const;
PARAMETERDESCRIPTION
name

The name of the function.

include_containing_scopes

If true, search in containing scopes as well; if false, only search in this scope.

RETURNSDESCRIPTION
std::shared_ptr< Function >

The function if it exists, nullptr otherwise.

method get_functionsconst

Get the functions defined in this scope. It does not include functions defined in containing scopes.

DEFINITION
Collection< Function >  get_functions ( ) const;
RETURNSDESCRIPTION
Collection< Function >

A collection of all functions.

method get_macroconst

Get a macro from the scope.

DEFINITION
std::shared_ptr< Macro >  get_macro ( Symbol  name,
bool  include_containing_scopes = true ) const;
PARAMETERDESCRIPTION
name

The name of the macro.

include_containing_scopes

If true, search in containing scopes as well; if false, only search in this scope.

RETURNSDESCRIPTION
std::shared_ptr< Macro >

The macro if it exists, nullptr otherwise.

method get_macrosconst

Get the macros defined in this scope. It does not include macros defined in containing scopes.

DEFINITION
Collection< Macro >  get_macros ( ) const;
RETURNSDESCRIPTION
Collection< Macro >

A collection of all macros.

method get_next_unnamed_labelconst

Get the next unnamed label after a location.

DEFINITION
std::optional< Expression >  get_next_unnamed_label ( const Location & location ) const;
PARAMETERDESCRIPTION
location

The location to get the next unnamed label after.

RETURNSDESCRIPTION
std::optional< Expression >

The next unnamed label after the location if it exists, {} otherwise.

method get_objectconst

Get an object from the scope.

DEFINITION
std::shared_ptr< Object >  get_object ( Symbol  name,
bool  include_containing_scopes = true ) const;
PARAMETERDESCRIPTION
name

The name of the object.

include_containing_scopes

If true, search in containing scopes as well; if false, only search in this scope.

RETURNSDESCRIPTION
std::shared_ptr< Object >

The object if it exists, nullptr otherwise.

method get_objectsconst

Get the objects defined in this scope. It does not include objects defined in containing scopes.

DEFINITION
Collection< Object >  get_objects ( ) const;
RETURNSDESCRIPTION
Collection< Object >

A collection of all objects.

method get_previous_unnamed_labelconst

Get the previous unnamed label before a location.

DEFINITION
std::optional< Expression >  get_previous_unnamed_label ( const Location & location ) const;
PARAMETERDESCRIPTION
location

The location to get the previous unnamed label before.

RETURNSDESCRIPTION
std::optional< Expression >

The previous unnamed label before the location if it exists, {} otherwise.

method get_type_nameprivate

Gets the type name of an entity for error reporting.

This is a helper function used in the add() template function.

DEFINITION
template <typename T>
const char * get_type_name ( );
RETURNSDESCRIPTION
const char *

The name of the entity type.

method get_type_nameprivate

DEFINITION
const char * get_type_name ( );
RETURNSDESCRIPTION
const char *

method get_type_nameprivate

DEFINITION
const char * get_type_name ( );
RETURNSDESCRIPTION
const char *

method get_type_nameprivate

DEFINITION
const char * get_type_name ( );
RETURNSDESCRIPTION
const char *

method get_type_nameprivate

DEFINITION
const char * get_type_name ( );
RETURNSDESCRIPTION
const char *

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 is_definedconst

Check if a preprocessor symbol is defined in the scope.

DEFINITION
bool  is_defined ( Symbol  name ) const;
PARAMETERDESCRIPTION
name

The name of the symbol.

RETURNSDESCRIPTION
bool

true if the symbol is defined, false otherwise.

method mark_used

Explicitly mark an object as used.

This will ensure that the object is included in the final output, even if it is not referenced by any other used entities.

DEFINITION
void  mark_used ( Location  location,
Symbol  object_name );
PARAMETERDESCRIPTION
location
object_name

The name of the object to mark as used.

method nameconst

Get the name of the scope.

DEFINITION
Symbol  name ( ) const;
RETURNSDESCRIPTION
Symbol

The name of the scope.

method parentconst

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

method pin

Pin an object to a specific address.

DEFINITION
void  pin ( Location  location,
Symbol  object_name,
Address  address,
bool  mark_used );
PARAMETERDESCRIPTION
location
object_name

The name of the object.

address

The address to pin the object to.

mark_used

method remove_constant

DEFINITION
void  remove_constant ( Symbol  name );
PARAMETERDESCRIPTION
name

method rename

Rename the scope.

DEFINITION
void  rename ( Symbol  new_name );
PARAMETERDESCRIPTION
new_name

The new name of the scope.

method resolve

Resolve names and expressions in the scope.

This function does not resolve the contained entities.

DEFINITION
void  resolve ( );

method typeconst

Get the type of the scope.

DEFINITION
Visibility  type ( ) const;
RETURNSDESCRIPTION
Visibility

The type of the scope.

method undefine

Undefine a preprocessor symbol in the scope.

This will not undef the symbol in parent scopes.

DEFINITION
void  undefine ( Symbol  name );
PARAMETERDESCRIPTION
name

The name of the symbol.

method unnamed_label_countconst

Get the number of unnamed labels in the scope.

DEFINITION
size_t  unnamed_label_count ( ) const;
RETURNSDESCRIPTION
size_t

The number of unnamed labels.

member constantsprivate

The constants in the environment.

DEFINITION
std::unordered_map< Symbol, std::weak_ptr< Constant > >  constants;

member containedprivate

The named scopes contained in this scope.

DEFINITION
std::unordered_map< Symbol, Scope * >  contained;

member definesprivate

The preprocessor defines in the scope.

DEFINITION
std::unordered_set< Symbol >  defines;

member explicitly_used_object_namesprivate

The names of the objects that have been explicitly marked as used and the location where they were marked.

These will be resolved and marked used by resolve() once all names are defined.

DEFINITION
std::vector< MarkedUsed >  explicitly_used_object_names;

member functionsprivate

The functions in the environment.

DEFINITION
std::unordered_map< Symbol, std::weak_ptr< Function > >  functions;

member macrosprivate

The macros in the environment.

DEFINITION
std::unordered_map< Symbol, std::weak_ptr< Macro > >  macros;

member name_private

The name of the scope.

DEFINITION
Symbol  name_;

member nextprivate

The scopes to search for symbols not found in this scope.

DEFINITION
std::vector< std::shared_ptr< Scope > >  next;

member objectsprivate

The objects in the environment.

DEFINITION
std::unordered_map< Symbol, std::weak_ptr< Object > >  objects;

member pinned_object_namesprivate

The objects that have been pinned to specific addresses.

These will be resolved and the address of the objects set by resolve() once all names are defined.

DEFINITION
std::vector< Pin >  pinned_object_names;

member type_private

The type of the scope.

DEFINITION
Visibility  type_;

member undefine_overridesprivate

The preprocessor defines explicitly undefined in this scope.

This is used to override defines in parent scopes.

DEFINITION
std::unordered_set< Symbol >  undefine_overrides;

member unnamed_labelsprivate

List of unnamed labels in the scope. This is only allowed in entity scopes.

DEFINITION
UnnamedLabelList  unnamed_labels;

class AllCollections

DEFINITION
class AllCollections;

class Iterator

DEFINITION
class Iterator;

constructor Iterator

DEFINITION
Iterator ( const Scope * scope,
std::unordered_map< Symbol, std::weak_ptr< Constant > >::const_iterator  constant_it,
std::unordered_map< Symbol, std::weak_ptr< Function > >::const_iterator  function_it,
std::unordered_map< Symbol, std::weak_ptr< Macro > >::const_iterator  macro_it,
std::unordered_map< Symbol, std::weak_ptr< Object > >::const_iterator  object_it );
PARAMETERDESCRIPTION
scope
constant_it
function_it
macro_it
object_it

method operator!=const

DEFINITION
bool  operator!= ( const Iterator & other ) const;
PARAMETERDESCRIPTION
other
RETURNSDESCRIPTION
bool

method operator*const

DEFINITION
value_type  operator* ( ) const;
RETURNSDESCRIPTION
value_type

method operator++

DEFINITION
Iterator & operator++ ( );
RETURNSDESCRIPTION
Iterator &

method operator++

DEFINITION
Iterator  operator++ ( int  );
PARAMETERDESCRIPTION
RETURNSDESCRIPTION
Iterator

method operator==const

DEFINITION
bool  operator== ( const Iterator & other ) const;
PARAMETERDESCRIPTION
other
RETURNSDESCRIPTION
bool

member constant_itprivate

DEFINITION
std::unordered_map< Symbol, std::weak_ptr< Constant > >::const_iterator  constant_it;

member function_itprivate

DEFINITION
std::unordered_map< Symbol, std::weak_ptr< Function > >::const_iterator  function_it;

member macro_itprivate

DEFINITION
std::unordered_map< Symbol, std::weak_ptr< Macro > >::const_iterator  macro_it;

member object_itprivate

DEFINITION
std::unordered_map< Symbol, std::weak_ptr< Object > >::const_iterator  object_it;

member scopeprivate

DEFINITION
const Scope * scope;

constructor AllCollections

DEFINITION
AllCollections ( const Scope * scope );
PARAMETERDESCRIPTION
scope

method beginconst

DEFINITION
Iterator  begin ( ) const;
RETURNSDESCRIPTION
Iterator

method endconst

DEFINITION
Iterator  end ( ) const;
RETURNSDESCRIPTION
Iterator

member scopeprivate

DEFINITION
const Scope * scope;

class Iterator

DEFINITION
class Iterator;

constructor Iterator

DEFINITION
Iterator ( const Scope * scope,
std::unordered_map< Symbol, std::weak_ptr< Constant > >::const_iterator  constant_it,
std::unordered_map< Symbol, std::weak_ptr< Function > >::const_iterator  function_it,
std::unordered_map< Symbol, std::weak_ptr< Macro > >::const_iterator  macro_it,
std::unordered_map< Symbol, std::weak_ptr< Object > >::const_iterator  object_it );
PARAMETERDESCRIPTION
scope
constant_it
function_it
macro_it
object_it

method operator!=const

DEFINITION
bool  operator!= ( const Iterator & other ) const;
PARAMETERDESCRIPTION
other
RETURNSDESCRIPTION
bool

method operator*const

DEFINITION
value_type  operator* ( ) const;
RETURNSDESCRIPTION
value_type

method operator++

DEFINITION
Iterator & operator++ ( );
RETURNSDESCRIPTION
Iterator &

method operator++

DEFINITION
Iterator  operator++ ( int  );
PARAMETERDESCRIPTION
RETURNSDESCRIPTION
Iterator

method operator==const

DEFINITION
bool  operator== ( const Iterator & other ) const;
PARAMETERDESCRIPTION
other
RETURNSDESCRIPTION
bool

member constant_itprivate

DEFINITION
std::unordered_map< Symbol, std::weak_ptr< Constant > >::const_iterator  constant_it;

member function_itprivate

DEFINITION
std::unordered_map< Symbol, std::weak_ptr< Function > >::const_iterator  function_it;

member macro_itprivate

DEFINITION
std::unordered_map< Symbol, std::weak_ptr< Macro > >::const_iterator  macro_it;

member object_itprivate

DEFINITION
std::unordered_map< Symbol, std::weak_ptr< Object > >::const_iterator  object_it;

member scopeprivate

DEFINITION
const Scope * scope;

class Collection

Represents an unordered collection of entities in the scope.

It provides an iterator to iterate over the elements in the collection.

DEFINITION
template <typename T> class Collection;

class Iterator

Iterator for the collection.

DEFINITION
class Iterator;

constructor Iterator

Initialize the iterator with the given unordered map iterator.

DEFINITION
Iterator ( std::unordered_map< Symbol, std::weak_ptr< T > >::const_iterator  it );
PARAMETERDESCRIPTION
it

The unordered map iterator.

method operator!=const

Check if the iterator is not equal to another iterator.

DEFINITION
bool  operator!= ( const Iterator & other ) const;
PARAMETERDESCRIPTION
other

The other iterator to compare with.

RETURNSDESCRIPTION
bool

true if the iterators are not equal, false otherwise.

method operator*const

Dereference the iterator.

DEFINITION
value_type  operator* ( ) const;
RETURNSDESCRIPTION
value_type

The entity pointed to by the iterator.

method operator++

Pre-increment the iterator.

DEFINITION
Iterator & operator++ ( );
RETURNSDESCRIPTION
Iterator &

The incremented iterator.

method operator++

Post-increment the iterator.

DEFINITION
Iterator  operator++ ( int  );
PARAMETERDESCRIPTION
RETURNSDESCRIPTION
Iterator

The iterator before incrementing.

method operator->const

Get the pointer to the entity pointed to by the iterator.

DEFINITION
pointer  operator-> ( ) const;
RETURNSDESCRIPTION
pointer

The pointer to the entity.

method operator==const

Check if the iterator is equal to another iterator.

DEFINITION
bool  operator== ( const Iterator & other ) const;
PARAMETERDESCRIPTION
other

The other iterator to compare with.

RETURNSDESCRIPTION
bool

true if the iterators are equal, false otherwise.

member itprivate

The underlying unordered map iterator.

DEFINITION
std::unordered_map< Symbol, std::weak_ptr< T > >::const_iterator  it;

constructor Collection

Initialize the collection with the given unordered map.

DEFINITION
Collection ( const std::unordered_map< Symbol, std::weak_ptr< T > > & collection );
PARAMETERDESCRIPTION
collection

The unordered map containing the entities.

method beginconst

Get the beginning iterator of the collection.

DEFINITION
Iterator  begin ( ) const;
RETURNSDESCRIPTION
Iterator

The beginning iterator.

method endconst

Get the end iterator of the collection.

DEFINITION
Iterator  end ( ) const;
RETURNSDESCRIPTION
Iterator

The end iterator.

method sizeconst

Get the size of the collection.

DEFINITION
size_t  size ( ) const;
RETURNSDESCRIPTION
size_t

The number of entities in the collection.

member collectionprivate

The underlying unordered map containing the entities.

DEFINITION
const std::unordered_map< Symbol, std::weak_ptr< T > > & collection;

class Iterator

Iterator for the collection.

DEFINITION
class Iterator;

constructor Iterator

Initialize the iterator with the given unordered map iterator.

DEFINITION
Iterator ( std::unordered_map< Symbol, std::weak_ptr< T > >::const_iterator  it );
PARAMETERDESCRIPTION
it

The unordered map iterator.

method operator!=const

Check if the iterator is not equal to another iterator.

DEFINITION
bool  operator!= ( const Iterator & other ) const;
PARAMETERDESCRIPTION
other

The other iterator to compare with.

RETURNSDESCRIPTION
bool

true if the iterators are not equal, false otherwise.

method operator*const

Dereference the iterator.

DEFINITION
value_type  operator* ( ) const;
RETURNSDESCRIPTION
value_type

The entity pointed to by the iterator.

method operator++

Pre-increment the iterator.

DEFINITION
Iterator & operator++ ( );
RETURNSDESCRIPTION
Iterator &

The incremented iterator.

method operator++

Post-increment the iterator.

DEFINITION
Iterator  operator++ ( int  );
PARAMETERDESCRIPTION
RETURNSDESCRIPTION
Iterator

The iterator before incrementing.

method operator->const

Get the pointer to the entity pointed to by the iterator.

DEFINITION
pointer  operator-> ( ) const;
RETURNSDESCRIPTION
pointer

The pointer to the entity.

method operator==const

Check if the iterator is equal to another iterator.

DEFINITION
bool  operator== ( const Iterator & other ) const;
PARAMETERDESCRIPTION
other

The other iterator to compare with.

RETURNSDESCRIPTION
bool

true if the iterators are equal, false otherwise.

member itprivate

The underlying unordered map iterator.

DEFINITION
std::unordered_map< Symbol, std::weak_ptr< T > >::const_iterator  it;

class MarkedUsedprivate

DEFINITION
class MarkedUsed;

constructor MarkedUsed

DEFINITION
MarkedUsed ( Location  location,
Symbol  object_name );
PARAMETERDESCRIPTION
location
object_name

member location

DEFINITION
Location  location;

member object_name

DEFINITION
Symbol  object_name;

class Pinprivate

DEFINITION
class Pin;

constructor Pin

DEFINITION
Pin ( Location  location,
Symbol  object_name,
Address  address,
bool  mark_used );
PARAMETERDESCRIPTION
location
object_name
address
mark_used

member address

DEFINITION
Address  address;

member location

DEFINITION
Location  location;

member mark_used

DEFINITION
bool  mark_used;

member object_name

DEFINITION
Symbol  object_name;