5 #ifndef FORBCC_MODULE_H 6 #define FORBCC_MODULE_H 11 #include <templates/ordered_unique_list.hpp> 12 #include <templates/shareable.hpp> 71 std::shared_ptr<module>
find_module(
const std::string &name);
78 std::shared_ptr<type_struct>
find_struct(
const std::string &name);
85 std::shared_ptr<entity> find(
const std::string &name);
93 #endif //FORBCC_NAMESPACE_H void print_definition(code_ostream &out) const override
Prints module definition (should be called within a source file)
Definition: module.cpp:35
A template that can be used to declare a list of unique ordered items.
Definition: ordered_unique_list.hpp:16
module(const std::shared_ptr< entity > &parent, const std::string &name)
Using constructor from superclass.
Definition: module.hpp:35
module & operator=(module &&)=default
This class supports moving.
A template that can be used to ease the declaration of a shared_pointer of a given type...
Definition: shareable.hpp:13
std::shared_ptr< entity > parent() const
Returns the parent of the given entity.
Definition: entity.hpp:63
std::string name() const
Returns the name of the given entity.
Definition: entity.hpp:68
std::shared_ptr< module > find_module(const std::string &name)
Finds a module by its name (which may contain :: qualifiers), following C++ scope resolution and visi...
Definition: module.cpp:47
Represents a module, which basically is a namespace, so it's a collection of other entities...
Definition: module.hpp:21
~module() override=default
This class is virtual, so it requires a virtual destructor.
module()
Empty module, used to preallocate variables in arrays or to use later assignment operator.
Definition: module.hpp:32
static const std::shared_ptr< module > global_module
Static member representing the global namespace, used as base for the tree-like structure of entities...
Definition: module.hpp:26
This output stream supports indentation of code lines, which are formatted at each std::endl...
Definition: code_ostream.hpp:14
std::shared_ptr< module > get_module(const std::string &name)
Returns a pointer to a module identified by name, but only if said module is defined directly within ...
Definition: module.cpp:43
std::shared_ptr< type_struct > find_struct(const std::string &name)
Finds a custom structure type by its name (which may contain :: qualifiers), following C++ scope reso...
Definition: module.cpp:51
Definition: code_ostream.hpp:11
Any code entity that should be generated by the compiler: namespaces, classes, structures, methods, variables.
Definition: entity.hpp:18
void print_declaration(code_ostream &out) const override
Prints module declaration (should be called within a header file)
Definition: module.cpp:16