A small, fast, functional and scripting language for video games
Ark::internal::ConditionalExecutor Class Reference

Handles Conditional macros. More...

#include <Conditional.hpp>

+ Inheritance diagram for Ark::internal::ConditionalExecutor:
+ Collaboration diagram for Ark::internal::ConditionalExecutor:

Public Member Functions

bool applyMacro (Node &node) override
 Executes macros in the Node if the Executor can handle it. More...
bool canHandle (Node &node) override
 Checks if the executor can apply a macro on the passed Node. More...
 MacroExecutor (MacroProcessor *macroprocessor, unsigned debug=0)
 Construct a new Macro Executor object. More...
- Public Member Functions inherited from Ark::internal::MacroExecutor
 MacroExecutor (MacroProcessor *macroprocessor, unsigned debug=0)
 Construct a new Macro Executor object. More...
virtual ~MacroExecutor ()
 Need a virtual destructor to correctly destory object. More...

Additional Inherited Members

- Protected Member Functions inherited from Ark::internal::MacroExecutor
NodefindNearestMacro (const std::string &name)
 Find the nearest macro matching a giving name. More...
void registerMacro (Node &node)
 Registers macros based on their type. More...
bool isTruthy (const Node &node)
 Check if a node can be evaluated to true. More...
Node evaluate (Node &node, bool is_not_body)
 Evaluate only the macros. More...
void unify (const std::unordered_map< std::string, Node > &, Node &, Node *)
 Applies the spread operator. More...
void throwMacroProcessingError (const std::string &message, const Node &node)
 Throw a macro processing error. More...
bool applyMacroProxy (Node &node)
 Execute a node, trying to emplace macros calls. More...
bool isPredefined (const std::string &symbol)
 Check if a given symbol is a predefined macro. More...
- Protected Attributes inherited from Ark::internal::MacroExecutor
unsigned int m_debug

Detailed Description

Handles Conditional macros.

Definition at line 24 of file Conditional.hpp.

Member Function Documentation

◆ applyMacro()

bool Ark::internal::ConditionalExecutor::applyMacro ( Node node)

◆ canHandle()

bool Ark::internal::ConditionalExecutor::canHandle ( Node node)

Checks if the executor can apply a macro on the passed Node.

nodethe node that contains a macro

Implements Ark::internal::MacroExecutor.

Definition at line 37 of file Conditional.cpp.

References Ark::internal::Keyword, Ark::internal::Node::list(), Ark::internal::Macro, and Ark::internal::Node::nodeType().

◆ MacroExecutor()


Construct a new Macro Executor object.


Definition at line 36 of file Executor.cpp.

References Ark::internal::MacroExecutor::m_macroprocessor, and Ark::internal::MacroProcessor::unify().

The documentation for this class was generated from the following files: