Scope
class Scope
Represents a scope used for name resolution. It can be contained in other scopes.
Lookups search all containing scopes going outwards.
class AllCollections
class Iterator
constructor Iterator
| 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 | ); |
| PARAMETER | DESCRIPTION |
|---|---|
scope |
|
constant_it |
|
function_it |
|
macro_it |
|
object_it |
method operator!=const
| bool operator!= | ( | const Iterator & other | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
other |
| RETURNS | DESCRIPTION |
|---|---|
bool |
method operator*const
| value_type operator* | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
value_type |
method operator++
| Iterator & operator++ | ( | ); |
| RETURNS | DESCRIPTION |
|---|---|
Iterator & |
method operator++
| Iterator operator++ | ( | int | ); |
| PARAMETER | DESCRIPTION |
|---|---|
|
| RETURNS | DESCRIPTION |
|---|---|
Iterator |
method operator==const
| bool operator== | ( | const Iterator & other | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
other |
| RETURNS | DESCRIPTION |
|---|---|
bool |
member constant_itprivate
member function_itprivate
member macro_itprivate
member object_itprivate
member scopeprivate
constructor AllCollections
| AllCollections | ( | const Scope * scope | ); |
| PARAMETER | DESCRIPTION |
|---|---|
scope |
method beginconst
| Iterator begin | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
Iterator |
method endconst
| Iterator end | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
Iterator |
member scopeprivate
class Collection
Represents an unordered collection of entities in the scope.
It provides an iterator to iterate over the elements in the collection.
class Iterator
Iterator for the collection.
constructor Iterator
Initialize the iterator with the given unordered map iterator.
| Iterator | ( | std::unordered_map< Symbol, std::weak_ptr< T > >::const_iterator it | ); |
| PARAMETER | DESCRIPTION |
|---|---|
it |
The unordered map iterator. |
method operator!=const
Check if the iterator is not equal to another iterator.
| bool operator!= | ( | const Iterator & other | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
other |
The other iterator to compare with. |
| RETURNS | DESCRIPTION |
|---|---|
bool |
|
method operator*const
Dereference the iterator.
| value_type operator* | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
value_type |
The entity pointed to by the iterator. |
method operator++
Pre-increment the iterator.
| Iterator & operator++ | ( | ); |
| RETURNS | DESCRIPTION |
|---|---|
Iterator & |
The incremented iterator. |
method operator++
Post-increment the iterator.
| Iterator operator++ | ( | int | ); |
| PARAMETER | DESCRIPTION |
|---|---|
|
| RETURNS | DESCRIPTION |
|---|---|
Iterator |
The iterator before incrementing. |
method operator->const
Get the pointer to the entity pointed to by the iterator.
| pointer operator-> | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
pointer |
The pointer to the entity. |
method operator==const
Check if the iterator is equal to another iterator.
| bool operator== | ( | const Iterator & other | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
other |
The other iterator to compare with. |
| RETURNS | DESCRIPTION |
|---|---|
bool |
|
member itprivate
The underlying unordered map iterator.
constructor Collection
Initialize the collection with the given unordered map.
| Collection | ( | const std::unordered_map< Symbol, std::weak_ptr< T > > & collection | ); |
| PARAMETER | DESCRIPTION |
|---|---|
collection |
The unordered map containing the entities. |
method beginconst
Get the beginning iterator of the collection.
| Iterator begin | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
Iterator |
The beginning iterator. |
method endconst
Get the end iterator of the collection.
| Iterator end | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
Iterator |
The end iterator. |
method sizeconst
Get the size of the collection.
| size_t size | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
size_t |
The number of entities in the collection. |
member collectionprivate
The underlying unordered map containing the entities.
class MarkedUsedprivate
constructor MarkedUsed
| MarkedUsed | ( | Location location, | |
| Symbol object_name | ); |
| PARAMETER | DESCRIPTION |
|---|---|
location |
|
object_name |
member location
member object_name
class Pinprivate
constructor Pin
| Pin | ( | Location location, | |
| Symbol object_name, | |||
| Address address, | |||
| bool mark_used | ); |
| PARAMETER | DESCRIPTION |
|---|---|
location |
|
object_name |
|
address |
|
mark_used |
member address
member location
member mark_used
member object_name
constructor Scope
Constructs a scope not contained in another scope.
| Scope | ( | Visibility type, | |
| Symbol name = {} | ); |
| PARAMETER | DESCRIPTION |
|---|---|
type |
The type of the scope. |
name |
The name of the scope. |
constructor Scope
Constructs a named scope contained in another scope.
| Scope | ( | Visibility type, | |
| Symbol name, | |||
| std::shared_ptr< Scope > next | ); |
| PARAMETER | DESCRIPTION |
|---|---|
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.
| Scope | ( | Visibility type, | |
| std::shared_ptr< Scope > next | ); |
| PARAMETER | DESCRIPTION |
|---|---|
type |
The type of the scope. |
next |
The next scope. |
destructor ~Scope
| ~Scope | ( | ); |
method add
Add a constant to the scope.
| void add | ( | std::shared_ptr< Constant > constant | ); |
| PARAMETER | DESCRIPTION |
|---|---|
constant |
The constant to add. |
method add
Add a function to the scope.
| void add | ( | std::shared_ptr< Function > function | ); |
| PARAMETER | DESCRIPTION |
|---|---|
function |
The function to add. |
method add
Add a macro to the scope.
| void add | ( | std::shared_ptr< Macro > macro | ); |
| PARAMETER | DESCRIPTION |
|---|---|
macro |
The macro to add. |
method add
Add an object to the scope.
| void add | ( | std::shared_ptr< Object > object | ); |
| PARAMETER | DESCRIPTION |
|---|---|
object |
The object to add. |
method add_entity
| void add_entity | ( | std::shared_ptr< Entity > entity | ); |
| PARAMETER | DESCRIPTION |
|---|---|
entity |
method add_next
Add a new scope to the list of containing scopes.
| void add_next | ( | std::shared_ptr< Scope > new_next | ); |
| PARAMETER | DESCRIPTION |
|---|---|
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.
| Scope * add_precheck | ( | Visibility visibility, | |
| Symbol name, | |||
| const Location & location | ); |
| PARAMETER | DESCRIPTION |
|---|---|
visibility |
The visibility of the entity. |
name |
The name of the entity. |
location |
The location of the entity definition in the source code. |
| RETURNS | DESCRIPTION |
|---|---|
Scope * |
The scope to add the entity to. |
| THROWS | DESCRIPTION |
|---|---|
Exception |
if adding the entity is not allowed. |
method add_unnamed_label
| void add_unnamed_label | ( | const Location & location, | |
| Expression label_expression | ); |
| PARAMETER | DESCRIPTION |
|---|---|
location |
|
label_expression |
method can_containstatic private
Determines if a scope of type contained can be contained in a scope of type container.
| static bool can_contain | ( | Visibility container, | |
| Visibility contained | ); |
| PARAMETER | DESCRIPTION |
|---|---|
container |
The type of the containing scope. |
contained |
The type of the contained scope. |
| RETURNS | DESCRIPTION |
|---|---|
bool |
|
method can_renameconst
| bool can_rename | ( | Symbol new_name | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
new_name |
| RETURNS | DESCRIPTION |
|---|---|
bool |
method define
Define a preprocessor symbol in the scope.
| void define | ( | Symbol name | ); |
| PARAMETER | DESCRIPTION |
|---|---|
name |
The name of the symbol. |
method define
Define multiple preprocessor symbols in the scope.
| void define | ( | const std::unordered_set< Symbol > & names | ); |
| PARAMETER | DESCRIPTION |
|---|---|
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.
| const std::optional< Location > find_conflicting | ( | Symbol name, | |
| Visibility visibility | ); |
| PARAMETER | DESCRIPTION |
|---|---|
name |
The name of the entity. |
visibility |
| RETURNS | DESCRIPTION |
|---|---|
const std::optional< Location > |
The location of the conflicting entity, or {} if no conflict exists. |
method find_conflictingprivate
| const std::optional< Location > find_conflicting | ( | Symbol name, | |
| Visibility visibility | ); |
| PARAMETER | DESCRIPTION |
|---|---|
name |
|
visibility |
| RETURNS | DESCRIPTION |
|---|---|
const std::optional< Location > |
method find_conflictingprivate
| const std::optional< Location > find_conflicting | ( | Symbol name, | |
| Visibility visibility | ); |
| PARAMETER | DESCRIPTION |
|---|---|
name |
|
visibility |
| RETURNS | DESCRIPTION |
|---|---|
const std::optional< Location > |
method find_conflictingprivate
| const std::optional< Location > find_conflicting | ( | Symbol name, | |
| Visibility visibility | ); |
| PARAMETER | DESCRIPTION |
|---|---|
name |
|
visibility |
| RETURNS | DESCRIPTION |
|---|---|
const std::optional< Location > |
method find_conflictingprivate
| const std::optional< Location > find_conflicting | ( | Symbol name, | |
| Visibility visibility | ); |
| PARAMETER | DESCRIPTION |
|---|---|
name |
|
visibility |
| RETURNS | DESCRIPTION |
|---|---|
const std::optional< Location > |
method find_conflicting_constant_or_objectprivate
| std::optional< Location > find_conflicting_constant_or_object | ( | Symbol name, | |
| Visibility visibility | ); |
| PARAMETER | DESCRIPTION |
|---|---|
name |
|
visibility |
| RETURNS | DESCRIPTION |
|---|---|
std::optional< Location > |
method find_conflicting_functionprivate
| std::optional< Location > find_conflicting_function | ( | Symbol name | ); |
| PARAMETER | DESCRIPTION |
|---|---|
name |
| RETURNS | DESCRIPTION |
|---|---|
std::optional< Location > |
method find_conflicting_macroprivate
| std::optional< Location > find_conflicting_macro | ( | Symbol name | ); |
| PARAMETER | DESCRIPTION |
|---|---|
name |
| RETURNS | DESCRIPTION |
|---|---|
std::optional< Location > |
method find_containing_scopeprivate
Finds the first containing scope of a given visibility.
| Scope * find_containing_scope | ( | Visibility visibility | ); |
| PARAMETER | DESCRIPTION |
|---|---|
visibility |
The visibility of the containing scope to find. |
| RETURNS | DESCRIPTION |
|---|---|
Scope * |
The containing scope. |
| THROWS | DESCRIPTION |
|---|---|
Exception |
if no containing scope of the given visibility is found. |
method getconst private
Get an entity from a collection by name.
| std::shared_ptr< T > get | ( | const std::unordered_map< Symbol, std::weak_ptr< T > > & collection, | |
| Symbol name | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
collection |
The collection to search. |
name |
The name of the entity. |
| RETURNS | DESCRIPTION |
|---|---|
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.
| std::shared_ptr< T > get | ( | Symbol name, | |
| bool include_containing_scopes = true | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
name |
The name of the entity. |
include_containing_scopes |
If |
| RETURNS | DESCRIPTION |
|---|---|
std::shared_ptr< T > |
The entity, if found; otherwise, nullptr. |
method get_allconst
| Collection< T > get_all | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
Collection< T > |
method get_allconst
| Collection< Constant > get_all | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
Collection< Constant > |
method get_allconst
| Collection< Function > get_all | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
Collection< Function > |
method get_allconst
| Collection< Macro > get_all | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
Collection< Macro > |
method get_allconst
| Collection< Object > get_all | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
Collection< Object > |
method get_constantconst
Get a constant from the scope.
| std::shared_ptr< Constant > get_constant | ( | Symbol name, | |
| bool include_containing_scopes = true | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
name |
The name of the constant. |
include_containing_scopes |
If |
| RETURNS | DESCRIPTION |
|---|---|
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.
| Collection< Constant > get_constants | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
Collection< Constant > |
A collection of all constants. |
method get_definesconst
| const std::unordered_set< Symbol > & get_defines | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
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.
| std::shared_ptr< T > get_directly | ( | Symbol name | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
name |
The name of the entity. |
| RETURNS | DESCRIPTION |
|---|---|
std::shared_ptr< T > |
The entity, if found; otherwise, nullptr. |
method get_directlyconst private
| std::shared_ptr< Constant > get_directly | ( | Symbol name | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
name |
| RETURNS | DESCRIPTION |
|---|---|
std::shared_ptr< Constant > |
method get_directlyconst private
| std::shared_ptr< Function > get_directly | ( | Symbol name | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
name |
| RETURNS | DESCRIPTION |
|---|---|
std::shared_ptr< Function > |
method get_directlyconst private
| std::shared_ptr< Macro > get_directly | ( | Symbol name | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
name |
| RETURNS | DESCRIPTION |
|---|---|
std::shared_ptr< Macro > |
method get_directlyconst private
| std::shared_ptr< Object > get_directly | ( | Symbol name | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
name |
| RETURNS | DESCRIPTION |
|---|---|
std::shared_ptr< Object > |
method get_entitiesconst
| AllCollections get_entities | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
AllCollections |
method get_functionconst
Get a function from the scope.
| std::shared_ptr< Function > get_function | ( | Symbol name, | |
| bool include_containing_scopes = true | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
name |
The name of the function. |
include_containing_scopes |
If |
| RETURNS | DESCRIPTION |
|---|---|
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.
| Collection< Function > get_functions | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
Collection< Function > |
A collection of all functions. |
method get_macroconst
Get a macro from the scope.
| std::shared_ptr< Macro > get_macro | ( | Symbol name, | |
| bool include_containing_scopes = true | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
name |
The name of the macro. |
include_containing_scopes |
If |
| RETURNS | DESCRIPTION |
|---|---|
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.
| Collection< Macro > get_macros | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
Collection< Macro > |
A collection of all macros. |
method get_next_unnamed_labelconst
Get the next unnamed label after a location.
| std::optional< Expression > get_next_unnamed_label | ( | const Location & location | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
location |
The location to get the next unnamed label after. |
| RETURNS | DESCRIPTION |
|---|---|
std::optional< Expression > |
The next unnamed label after the location if it exists, {} otherwise. |
method get_objectconst
Get an object from the scope.
| std::shared_ptr< Object > get_object | ( | Symbol name, | |
| bool include_containing_scopes = true | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
name |
The name of the object. |
include_containing_scopes |
If |
| RETURNS | DESCRIPTION |
|---|---|
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.
| Collection< Object > get_objects | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
Collection< Object > |
A collection of all objects. |
method get_previous_unnamed_labelconst
Get the previous unnamed label before a location.
| std::optional< Expression > get_previous_unnamed_label | ( | const Location & location | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
location |
The location to get the previous unnamed label before. |
| RETURNS | DESCRIPTION |
|---|---|
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.
| const char * get_type_name | ( | ); |
| RETURNS | DESCRIPTION |
|---|---|
const char * |
The name of the entity type. |
method get_type_nameprivate
| const char * get_type_name | ( | ); |
| RETURNS | DESCRIPTION |
|---|---|
const char * |
method get_type_nameprivate
| const char * get_type_name | ( | ); |
| RETURNS | DESCRIPTION |
|---|---|
const char * |
method get_type_nameprivate
| const char * get_type_name | ( | ); |
| RETURNS | DESCRIPTION |
|---|---|
const char * |
method get_type_nameprivate
| const char * get_type_name | ( | ); |
| RETURNS | DESCRIPTION |
|---|---|
const char * |
method import
Import a module.
| void import | ( | Visibility visibility, | |
| const Module & module | ); |
| PARAMETER | DESCRIPTION |
|---|---|
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.
| bool is_defined | ( | Symbol name | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
name |
The name of the symbol. |
| RETURNS | DESCRIPTION |
|---|---|
bool |
|
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.
| void mark_used | ( | Location location, | |
| Symbol object_name | ); |
| PARAMETER | DESCRIPTION |
|---|---|
location |
|
object_name |
The name of the object to mark as used. |
method nameconst
Get the name of the scope.
| Symbol name | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
Symbol |
The name of the scope. |
method parentconst
| std::shared_ptr< Scope > parent | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
std::shared_ptr< Scope > |
method pin
Pin an object to a specific address.
| void pin | ( | Location location, | |
| Symbol object_name, | |||
| Address address, | |||
| bool mark_used | ); |
| PARAMETER | DESCRIPTION |
|---|---|
location |
|
object_name |
The name of the object. |
address |
The address to pin the object to. |
mark_used |
method remove_constant
| void remove_constant | ( | Symbol name | ); |
| PARAMETER | DESCRIPTION |
|---|---|
name |
method rename
Rename the scope.
| void rename | ( | Symbol new_name | ); |
| PARAMETER | DESCRIPTION |
|---|---|
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.
| void resolve | ( | ); |
method typeconst
Get the type of the scope.
| Visibility type | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
Visibility |
The type of the scope. |
method undefine
Undefine a preprocessor symbol in the scope.
This will not undef the symbol in parent scopes.
| void undefine | ( | Symbol name | ); |
| PARAMETER | DESCRIPTION |
|---|---|
name |
The name of the symbol. |
method unnamed_label_countconst
Get the number of unnamed labels in the scope.
| size_t unnamed_label_count | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
size_t |
The number of unnamed labels. |
member constantsprivate
The constants in the environment.
member containedprivate
The named scopes contained in this scope.
member definesprivate
The preprocessor defines in the scope.
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.
member functionsprivate
The functions in the environment.
member macrosprivate
The macros in the environment.
member name_private
The name of the scope.
member nextprivate
The scopes to search for symbols not found in this scope.
member objectsprivate
The objects in the environment.
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.
member type_private
The type of the scope.
member undefine_overridesprivate
The preprocessor defines explicitly undefined in this scope.
This is used to override defines in parent scopes.
member unnamed_labelsprivate
List of unnamed labels in the scope. This is only allowed in entity scopes.
class AllCollections
class Iterator
constructor Iterator
| 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 | ); |
| PARAMETER | DESCRIPTION |
|---|---|
scope |
|
constant_it |
|
function_it |
|
macro_it |
|
object_it |
method operator!=const
| bool operator!= | ( | const Iterator & other | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
other |
| RETURNS | DESCRIPTION |
|---|---|
bool |
method operator*const
| value_type operator* | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
value_type |
method operator++
| Iterator & operator++ | ( | ); |
| RETURNS | DESCRIPTION |
|---|---|
Iterator & |
method operator++
| Iterator operator++ | ( | int | ); |
| PARAMETER | DESCRIPTION |
|---|---|
|
| RETURNS | DESCRIPTION |
|---|---|
Iterator |
method operator==const
| bool operator== | ( | const Iterator & other | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
other |
| RETURNS | DESCRIPTION |
|---|---|
bool |
member constant_itprivate
member function_itprivate
member macro_itprivate
member object_itprivate
member scopeprivate
constructor AllCollections
| AllCollections | ( | const Scope * scope | ); |
| PARAMETER | DESCRIPTION |
|---|---|
scope |
method beginconst
| Iterator begin | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
Iterator |
method endconst
| Iterator end | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
Iterator |
member scopeprivate
class Iterator
constructor Iterator
| 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 | ); |
| PARAMETER | DESCRIPTION |
|---|---|
scope |
|
constant_it |
|
function_it |
|
macro_it |
|
object_it |
method operator!=const
| bool operator!= | ( | const Iterator & other | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
other |
| RETURNS | DESCRIPTION |
|---|---|
bool |
method operator*const
| value_type operator* | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
value_type |
method operator++
| Iterator & operator++ | ( | ); |
| RETURNS | DESCRIPTION |
|---|---|
Iterator & |
method operator++
| Iterator operator++ | ( | int | ); |
| PARAMETER | DESCRIPTION |
|---|---|
|
| RETURNS | DESCRIPTION |
|---|---|
Iterator |
method operator==const
| bool operator== | ( | const Iterator & other | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
other |
| RETURNS | DESCRIPTION |
|---|---|
bool |
member constant_itprivate
member function_itprivate
member macro_itprivate
member object_itprivate
member scopeprivate
class Collection
Represents an unordered collection of entities in the scope.
It provides an iterator to iterate over the elements in the collection.
class Iterator
Iterator for the collection.
constructor Iterator
Initialize the iterator with the given unordered map iterator.
| Iterator | ( | std::unordered_map< Symbol, std::weak_ptr< T > >::const_iterator it | ); |
| PARAMETER | DESCRIPTION |
|---|---|
it |
The unordered map iterator. |
method operator!=const
Check if the iterator is not equal to another iterator.
| bool operator!= | ( | const Iterator & other | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
other |
The other iterator to compare with. |
| RETURNS | DESCRIPTION |
|---|---|
bool |
|
method operator*const
Dereference the iterator.
| value_type operator* | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
value_type |
The entity pointed to by the iterator. |
method operator++
Pre-increment the iterator.
| Iterator & operator++ | ( | ); |
| RETURNS | DESCRIPTION |
|---|---|
Iterator & |
The incremented iterator. |
method operator++
Post-increment the iterator.
| Iterator operator++ | ( | int | ); |
| PARAMETER | DESCRIPTION |
|---|---|
|
| RETURNS | DESCRIPTION |
|---|---|
Iterator |
The iterator before incrementing. |
method operator->const
Get the pointer to the entity pointed to by the iterator.
| pointer operator-> | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
pointer |
The pointer to the entity. |
method operator==const
Check if the iterator is equal to another iterator.
| bool operator== | ( | const Iterator & other | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
other |
The other iterator to compare with. |
| RETURNS | DESCRIPTION |
|---|---|
bool |
|
member itprivate
The underlying unordered map iterator.
constructor Collection
Initialize the collection with the given unordered map.
| Collection | ( | const std::unordered_map< Symbol, std::weak_ptr< T > > & collection | ); |
| PARAMETER | DESCRIPTION |
|---|---|
collection |
The unordered map containing the entities. |
method beginconst
Get the beginning iterator of the collection.
| Iterator begin | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
Iterator |
The beginning iterator. |
method endconst
Get the end iterator of the collection.
| Iterator end | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
Iterator |
The end iterator. |
method sizeconst
Get the size of the collection.
| size_t size | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
size_t |
The number of entities in the collection. |
member collectionprivate
The underlying unordered map containing the entities.
class Iterator
Iterator for the collection.
constructor Iterator
Initialize the iterator with the given unordered map iterator.
| Iterator | ( | std::unordered_map< Symbol, std::weak_ptr< T > >::const_iterator it | ); |
| PARAMETER | DESCRIPTION |
|---|---|
it |
The unordered map iterator. |
method operator!=const
Check if the iterator is not equal to another iterator.
| bool operator!= | ( | const Iterator & other | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
other |
The other iterator to compare with. |
| RETURNS | DESCRIPTION |
|---|---|
bool |
|
method operator*const
Dereference the iterator.
| value_type operator* | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
value_type |
The entity pointed to by the iterator. |
method operator++
Pre-increment the iterator.
| Iterator & operator++ | ( | ); |
| RETURNS | DESCRIPTION |
|---|---|
Iterator & |
The incremented iterator. |
method operator++
Post-increment the iterator.
| Iterator operator++ | ( | int | ); |
| PARAMETER | DESCRIPTION |
|---|---|
|
| RETURNS | DESCRIPTION |
|---|---|
Iterator |
The iterator before incrementing. |
method operator->const
Get the pointer to the entity pointed to by the iterator.
| pointer operator-> | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
pointer |
The pointer to the entity. |
method operator==const
Check if the iterator is equal to another iterator.
| bool operator== | ( | const Iterator & other | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
other |
The other iterator to compare with. |
| RETURNS | DESCRIPTION |
|---|---|
bool |
|
member itprivate
The underlying unordered map iterator.
class MarkedUsedprivate
constructor MarkedUsed
| MarkedUsed | ( | Location location, | |
| Symbol object_name | ); |
| PARAMETER | DESCRIPTION |
|---|---|
location |
|
object_name |
member location
member object_name
class Pinprivate
constructor Pin
| Pin | ( | Location location, | |
| Symbol object_name, | |||
| Address address, | |||
| bool mark_used | ); |
| PARAMETER | DESCRIPTION |
|---|---|
location |
|
object_name |
|
address |
|
mark_used |