Environment for accessing variables.
More...
#include <syntax.hpp>
|
|
| Environment (GCMain &gc, Lexer *lexer=nullptr, Environment *parent=nullptr) |
| |
| bool | contains (const std::string &name) const noexcept |
| |
| const Expr * | get (const std::string &name) const noexcept |
| |
| const Expr * | currentGet (const std::string &name) const noexcept |
| |
|
virtual void | mark (GCMain &gc) noexcept override |
| | If not marked mark itself and children.
|
| |
|
std::map< std::string, Expr * > & | getVariables () noexcept |
| |
| Environment * | getParent () const noexcept |
| |
|
| GCObj (GCMain &main) noexcept |
| | Initialize as not marked.
|
| |
| virtual bool | isMarked (GCMain &main) const noexcept |
| |
|
|
Lexer * | lexer |
| |
|
std::vector< Expr * > | ctx |
| | Context to store e.g. stack variables.
|
| |
Environment for accessing variables.
◆ contains()
| bool Environment::contains |
( |
const std::string & |
name | ) |
const |
|
noexcept |
- Returns
- Returns name if in environment, nullptr if not.
◆ currentGet()
| const Expr* Environment::currentGet |
( |
const std::string & |
name | ) |
const |
|
noexcept |
- Returns
- Returns associated expression (to name), nullptr if not found. But only looks in current scope/environment, not in parent.
◆ get()
| const Expr* Environment::get |
( |
const std::string & |
name | ) |
const |
|
noexcept |
- Returns
- Returns associated expression (to name). nullptr if not found.
◆ getParent()
- Returns
- Returns parent of environment/scope. May be nullptr.
The documentation for this class was generated from the following file: