|
forb
|
Any code entity that should be generated by the compiler: namespaces, classes, structures, methods, variables. More...
#include <entity.hpp>
Public Member Functions | |
| entity () | |
| Constructs an empty entity, used to preallocate entity variables (like in arrays) and to later use the assignment operator to overwrite its content. | |
| entity (const std::shared_ptr< entity > &parent, const std::string &name) | |
| Constructs an entity within a given parent. | |
| virtual | ~entity ()=default |
| Does nothing because the destructor of the shared_ptr handles all the stuff It's necessary for the destructor to be virtual because share_ptrs to subclasses shall be able to correctly destruct objects of the subclasses. More... | |
| entity (entity &&)=default | |
| This class supports moving. | |
| entity & | operator= (entity &&)=default |
| This class supports moving. | |
| entity (const entity &)=default | |
| This class supports copying. | |
| entity & | operator= (const entity &)=default |
| This class supports copying. | |
| std::shared_ptr< entity > | parent () const |
| Returns the parent of the given entity. | |
| std::string | name () const |
| Returns the name of the given entity. | |
| virtual void | print_declaration (code_ostream &out) const =0 |
| Prints the declaration of the given entity, if required. | |
| virtual void | print_definition (code_ostream &out) const =0 |
| Prints the definition of the given entity, if required. | |
| virtual std::string | codename () const |
| Returns the codename of the given entity, which is the name of the entity as seen from the global scope. More... | |
Any code entity that should be generated by the compiler: namespaces, classes, structures, methods, variables.
|
virtualdefault |
Does nothing because the destructor of the shared_ptr handles all the stuff It's necessary for the destructor to be virtual because share_ptrs to subclasses shall be able to correctly destruct objects of the subclasses.
Also subclasses shall have virtual destructors
|
inlinevirtual |
Returns the codename of the given entity, which is the name of the entity as seen from the global scope.
This means that it is the codename of the parent entity followed by :: operator and the name of the given entity.
Reimplemented in forbcc::type_primitive.
1.8.12