![]() |
ArkScript
A small, fast, functional and scripting language for video games
|
#include <StaticScope.hpp>
Public Member Functions | |
NamespaceScope (std::string name, bool with_prefix, bool is_glob, const std::vector< std::string > &symbols) | |
std::string | add (const std::string &name, bool is_mutable) override |
Add a Declaration to the scope, given a mutability status. | |
std::optional< Declaration > | get (const std::string &name, bool extensive_lookup) override |
Try to return a Declaration from this scope with a given name. | |
std::string | fullyQualifiedName (const std::string &name) const override |
Given a Declaration name, compute its fully qualified name. | |
bool | saveNamespace (std::unique_ptr< StaticScope > &) override |
Save a namespace scope to help with lookup. | |
bool | isNamespace () const override |
bool | withPrefix () const override |
bool | isGlob () const override |
std::string | prefix () const override |
bool | hasSymbol (const std::string &symbol) const override |
bool | recursiveHasSymbol (const std::string &symbol) const override |
![]() | |
virtual | ~StaticScope ()=default |
Private Attributes | |
std::string | m_namespace |
bool | m_with_prefix |
bool | m_is_glob |
std::vector< std::string > | m_symbols |
std::unordered_set< Declaration > | m_vars {} |
std::vector< std::unique_ptr< StaticScope > > | m_additional_namespaces |
Definition at line 91 of file StaticScope.hpp.
Ark::internal::NamespaceScope::NamespaceScope | ( | std::string | name, |
bool | with_prefix, | ||
bool | is_glob, | ||
const std::vector< std::string > & | symbols ) |
Definition at line 37 of file StaticScope.cpp.
|
overridevirtual |
Add a Declaration to the scope, given a mutability status.
name | |
is_mutable |
Reimplemented from Ark::internal::StaticScope.
Definition at line 45 of file StaticScope.cpp.
References fullyQualifiedName(), hasSymbol(), m_is_glob, m_namespace, m_symbols, m_vars, and m_with_prefix.
|
nodiscardoverridevirtual |
Given a Declaration name, compute its fully qualified name.
name |
Reimplemented from Ark::internal::StaticScope.
Definition at line 104 of file StaticScope.cpp.
References m_namespace.
|
nodiscardoverridevirtual |
Try to return a Declaration from this scope with a given name.
name | |
extensive_lookup | if true, use the additional saved namespaces |
Reimplemented from Ark::internal::StaticScope.
Definition at line 67 of file StaticScope.cpp.
References fullyQualifiedName(), hasSymbol(), m_additional_namespaces, m_is_glob, m_namespace, m_symbols, m_vars, m_with_prefix, Ark::internal::Declaration::name, and Ark::internal::Declaration::original_name.
|
inlinenodiscardoverridevirtual |
Reimplemented from Ark::internal::StaticScope.
Definition at line 130 of file StaticScope.hpp.
References m_symbols.
Referenced by add(), get(), and recursiveHasSymbol().
|
inlinenodiscardoverridevirtual |
Reimplemented from Ark::internal::StaticScope.
Definition at line 128 of file StaticScope.hpp.
References m_is_glob.
|
nodiscardoverridevirtual |
Reimplemented from Ark::internal::StaticScope.
Definition at line 118 of file StaticScope.cpp.
|
inlinenodiscardoverridevirtual |
Reimplemented from Ark::internal::StaticScope.
Definition at line 129 of file StaticScope.hpp.
References m_namespace.
|
inlinenodiscardoverridevirtual |
Reimplemented from Ark::internal::StaticScope.
Definition at line 131 of file StaticScope.hpp.
References hasSymbol(), and m_additional_namespaces.
|
overridevirtual |
Save a namespace scope to help with lookup.
Reimplemented from Ark::internal::StaticScope.
Definition at line 112 of file StaticScope.cpp.
References m_additional_namespaces.
|
inlinenodiscardoverridevirtual |
Reimplemented from Ark::internal::StaticScope.
Definition at line 127 of file StaticScope.hpp.
References m_with_prefix.
|
private |
Definition at line 149 of file StaticScope.hpp.
Referenced by get(), recursiveHasSymbol(), and saveNamespace().
|
private |
Definition at line 146 of file StaticScope.hpp.
|
private |
Definition at line 144 of file StaticScope.hpp.
Referenced by add(), fullyQualifiedName(), get(), and prefix().
|
private |
Definition at line 147 of file StaticScope.hpp.
Referenced by add(), get(), and hasSymbol().
|
private |
Definition at line 148 of file StaticScope.hpp.
|
private |
Definition at line 145 of file StaticScope.hpp.
Referenced by add(), get(), and withPrefix().