|
Bash++
Bash++ compiler internal documentation
|
The base class for all entities in the Bash++ compiler. More...
#include <bpp.h>


Public Member Functions | |
| virtual | ~bpp_entity ()=default |
| virtual bool | add_class (std::shared_ptr< bpp_class > class_) |
| Add a class to this entity's list of classes. | |
| virtual bool | add_object (std::shared_ptr< bpp_object > object, bool make_local=false) |
| Add an object to this entity's list of objects. | |
| virtual std::shared_ptr< bpp_class > | get_class () |
| virtual std::string | get_address () const |
| virtual void | set_name (const std::string &name) |
| virtual std::string | get_name () const |
| virtual std::weak_ptr< bpp::bpp_class > | get_containing_class () |
| Get the class which contains this entity. | |
| virtual bool | set_containing_class (std::weak_ptr< bpp::bpp_class > containing_class) |
| virtual void | inherit (std::shared_ptr< bpp_entity > parent) |
| Inherit from a parent entity. | |
| virtual void | inherit (std::shared_ptr< bpp_class > parent) |
| void | set_definition_position (const std::string &file, uint64_t line, uint64_t column) |
| void | add_reference (const std::string &file, uint64_t line, uint64_t column) |
| bpp::SymbolPosition | get_initial_definition () const |
| std::list< bpp::SymbolPosition > | get_references () const |
| std::unordered_map< std::string, std::shared_ptr< bpp_class > > | get_classes () const |
| std::unordered_map< std::string, std::shared_ptr< bpp_object > > | get_objects () const |
| std::shared_ptr< bpp_class > | get_class (const std::string &name) |
| std::shared_ptr< bpp_object > | get_object (const std::string &name) |
| std::shared_ptr< bpp_class > | get_parent () const |
Protected Attributes | |
| std::string | name = "" |
| std::unordered_map< std::string, std::shared_ptr< bpp_class > > | classes |
| A map of class names to class objects within this entity. | |
| std::unordered_map< std::string, std::shared_ptr< bpp_object > > | objects |
| A map of object names to bpp_objects within this entity. | |
| std::unordered_map< std::string, std::shared_ptr< bpp_object > > | local_objects |
| Like objects, but only for objects whose scope is local to this entity. | |
| std::shared_ptr< bpp_class > | type = nullptr |
| std::weak_ptr< bpp_class > | containing_class |
| std::vector< std::shared_ptr< bpp_class > > | parents |
| bpp::SymbolPosition | initial_definition |
| std::list< bpp::SymbolPosition > | references |
The base class for all entities in the Bash++ compiler.
An entity is a class, object, method, or other construct in the Bash++ compiler. This class provides the basic functionality for all entities.
|
virtualdefault |
|
virtual |
Add a class to this entity's list of classes.
| class_ | The class to add |
Reimplemented in bpp::bpp_program.
|
virtual |
Add an object to this entity's list of objects.
| object | The object to add |
Reimplemented in bpp::bpp_method, and bpp::bpp_code_entity.
| void bpp::bpp_entity::add_reference | ( | const std::string & | file, |
| uint64_t | line, | ||
| uint64_t | column | ||
| ) |
|
virtual |
Reimplemented in bpp::bpp_object, and bpp::bpp_datamember.
|
virtual |
Reimplemented in bpp::bpp_class, and bpp::bpp_object.
| std::shared_ptr< bpp::bpp_class > bpp::bpp_entity::get_class | ( | const std::string & | name | ) |
| std::unordered_map< std::string, std::shared_ptr< bpp_class > > bpp::bpp_entity::get_classes | ( | ) | const |
|
virtual |
Get the class which contains this entity.
Useful in many cases, for example in the event that this entity is a method of a particular class
Reimplemented in bpp::bpp_class.
| bpp::SymbolPosition bpp::bpp_entity::get_initial_definition | ( | ) | const |
|
virtual |
| std::shared_ptr< bpp::bpp_object > bpp::bpp_entity::get_object | ( | const std::string & | name | ) |
| std::unordered_map< std::string, std::shared_ptr< bpp_object > > bpp::bpp_entity::get_objects | ( | ) | const |
| std::shared_ptr< bpp::bpp_class > bpp::bpp_entity::get_parent | ( | ) | const |
| std::list< bpp::SymbolPosition > bpp::bpp_entity::get_references | ( | ) | const |
|
virtual |
Reimplemented in bpp::bpp_class.
|
virtual |
Inherit from a parent entity.
This function copies all classes and objects from the parent entity into this entity.
| parent | The parent entity to inherit from |
Reimplemented in bpp::bpp_class.
|
virtual |
Reimplemented in bpp::bpp_class.
| void bpp::bpp_entity::set_definition_position | ( | const std::string & | file, |
| uint64_t | line, | ||
| uint64_t | column | ||
| ) |
|
virtual |
Reimplemented in bpp::bpp_class.
|
protected |
A map of class names to class objects within this entity.
|
protected |
|
protected |
|
protected |
Like objects, but only for objects whose scope is local to this entity.
|
protected |
|
protected |
A map of object names to bpp_objects within this entity.
|
protected |
|
protected |
|
protected |