12#ifndef COMPILER_MACROS_SCOPE_HPP
13#define COMPILER_MACROS_SCOPE_HPP
17#include <unordered_map>
40 const Node*
has(
const std::string& name)
const;
48 void add(
const std::string& name,
const Node& node);
57 bool remove(
const std::string& name);
70 inline unsigned int depth()
const
76 std::unordered_map<std::string, Node>
m_macros;
AST node used by the parser, optimizer and compiler.
bool remove(const std::string &name)
Remove a macro in the scope, if it exists.
const Node * has(const std::string &name) const
Check if the current scope holds a value for a given symbol, and returns it as a pointer.
std::unordered_map< std::string, Node > m_macros
unsigned int depth() const
void add(const std::string &name, const Node &node)
Add a new entry in the scope.
bool empty() const
Return true if the current scope is empty.
A node of an Abstract Syntax Tree for ArkScript.