A class to handle the VM scope more efficiently.
More...
#include <Scope.hpp>
|
| Scope () noexcept |
| Construct a new Scope object.
|
|
void | push_back (uint16_t id, Value &&val) noexcept |
| Put a value in the scope.
|
|
void | push_back (uint16_t id, const Value &val) noexcept |
| Put a value in the scope.
|
|
bool | has (uint16_t id) noexcept |
| Check if the scope has a specific symbol in memory.
|
|
Value * | operator[] (uint16_t id) noexcept |
| Get a value from its symbol id.
|
|
uint16_t | idFromValue (const Value &val) const noexcept |
| Get the id of a variable based on its value ; used for debug only.
|
|
std::size_t | size () const noexcept |
| Return the size of the scope.
|
|
A class to handle the VM scope more efficiently.
Definition at line 27 of file Scope.hpp.
◆ Scope()
Ark::internal::Scope::Scope |
( |
| ) |
|
|
noexcept |
◆ has()
bool Ark::internal::Scope::has |
( |
uint16_t |
id | ) |
|
|
noexcept |
Check if the scope has a specific symbol in memory.
- Parameters
-
- Returns
- true On success
-
false Otherwise
Definition at line 22 of file Scope.cpp.
◆ idFromValue()
uint16_t Ark::internal::Scope::idFromValue |
( |
const Value & |
val | ) |
const |
|
noexcept |
Get the id of a variable based on its value ; used for debug only.
- Parameters
-
- Returns
- uint16_t
Definition at line 37 of file Scope.cpp.
◆ operator[]()
Value * Ark::internal::Scope::operator[] |
( |
uint16_t |
id | ) |
|
|
noexcept |
Get a value from its symbol id.
- Parameters
-
- Returns
- Value* Returns nullptr if the value can not be found
Definition at line 27 of file Scope.cpp.
◆ push_back() [1/2]
void Ark::internal::Scope::push_back |
( |
uint16_t |
id, |
|
|
const Value & |
val |
|
) |
| |
|
noexcept |
Put a value in the scope.
- Parameters
-
id | The symbol id of the variable |
val | The value linked to the symbol |
Definition at line 17 of file Scope.cpp.
◆ push_back() [2/2]
void Ark::internal::Scope::push_back |
( |
uint16_t |
id, |
|
|
Value && |
val |
|
) |
| |
|
noexcept |
Put a value in the scope.
- Parameters
-
id | The symbol id of the variable |
val | The value linked to the symbol |
Definition at line 12 of file Scope.cpp.
◆ size()
std::size_t Ark::internal::Scope::size |
( |
| ) |
const |
|
noexcept |
◆ Ark::internal::Closure
◆ Ark::VM
◆ m_data
std::vector<std::pair<uint16_t, Value> > Ark::internal::Scope::m_data |
|
private |
The documentation for this class was generated from the following files:
- /Users/fola/Documents/ArkScript/Ark/include/Ark/VM/Scope.hpp
- /Users/fola/Documents/ArkScript/Ark/src/arkreactor/VM/Scope.cpp