The base class for all MacroExecutors.
Handles the macros and their expansion in ArkScript source code.
void applyMacroProxy(Node &node, unsigned depth)
Apply a macro on a given node.
MacroExecutor(MacroProcessor *processor, unsigned debug=0)
Construct a new Macro Executor object.
static void throwMacroProcessingError(const std::string &message, const Node &node)
Throw a macro processing error.
MacroProcessor * m_processor
This is a non-owned pointer.
Node evaluate(Node &node, unsigned depth, bool is_not_body) const
Evaluate only the macros.
bool isTruthy(const Node &node) const
Check if a node can be evaluated to true.
void handleMacroNode(Node &node) const
Registers macros based on their type, expand conditional macros.
const Node * findNearestMacro(const std::string &name) const
Find the nearest macro matching a giving name.
The class handling the macros definitions and calls, given an AST.
Node evaluate(Node &node, unsigned depth, bool is_not_body=false)
Evaluate only the macros.
bool applyMacro(Node &node, unsigned depth)
Apply a macro on a given node.
const Node * findNearestMacro(const std::string &name) const
Find the nearest macro matching a given name.
static bool isTruthy(const Node &node)
Check if a node can be evaluated to true.
static void throwMacroProcessingError(const std::string &message, const Node &node)
Throw a macro processing error.
void handleMacroNode(Node &node)
Registers macros based on their type, expand conditional macros.
A node of an Abstract Syntax Tree for ArkScript.