ArkScript
A small, fast, functional and scripting language for video games
Ark::internal::SymbolExecutor Class Referencefinal

Handles Symbol macros. More...

#include <Symbol.hpp>

Inheritance diagram for Ark::internal::SymbolExecutor:
[legend]
Collaboration diagram for Ark::internal::SymbolExecutor:
[legend]

Public Member Functions

bool applyMacro (Node &node, unsigned depth) override
 
bool canHandle (Node &node) override
 
 MacroExecutor (MacroProcessor *processor, unsigned debug=0)
 Construct a new Macro Executor object.
 
- Public Member Functions inherited from Ark::internal::MacroExecutor
 MacroExecutor (MacroProcessor *processor, unsigned debug=0)
 Construct a new Macro Executor object.
 
virtual ~MacroExecutor ()=default
 Need a virtual destructor to correctly destroy object.
 

Additional Inherited Members

- Protected Member Functions inherited from Ark::internal::MacroExecutor
const NodefindNearestMacro (const std::string &name) const
 Find the nearest macro matching a giving name.
 
void applyMacroProxy (Node &node, unsigned depth)
 Apply a macro on a given node.
 
void handleMacroNode (Node &node) const
 Registers macros based on their type, expand conditional macros.
 
bool isTruthy (const Node &node) const
 Check if a node can be evaluated to true.
 
Node evaluate (Node &node, unsigned depth, bool is_not_body) const
 Evaluate only the macros.
 
- Static Protected Member Functions inherited from Ark::internal::MacroExecutor
static void throwMacroProcessingError (const std::string &message, const Node &node)
 Throw a macro processing error.
 
- Protected Attributes inherited from Ark::internal::MacroExecutor
unsigned int m_debug
 
MacroProcessorm_processor
 This is a non-owned pointer.
 

Detailed Description

Handles Symbol macros.

Definition at line 24 of file Symbol.hpp.

Member Function Documentation

◆ applyMacro()

bool Ark::internal::SymbolExecutor::applyMacro ( Node & node,
unsigned depth )
overridevirtual
Parameters
node
depthdepth of the macro processor evalution
Returns
true if the applying worked

Implements Ark::internal::MacroExecutor.

Definition at line 10 of file Symbol.cpp.

References Ark::internal::MacroExecutor::applyMacroProxy(), Ark::internal::MacroExecutor::evaluate(), Ark::internal::MacroExecutor::findNearestMacro(), Ark::internal::Node::string(), and Ark::internal::Node::updateValueAndType().

◆ canHandle()

bool Ark::internal::SymbolExecutor::canHandle ( Node & node)
nodiscardoverridevirtual
Parameters
node
Returns
true if the executor can handle the given node

Implements Ark::internal::MacroExecutor.

Definition at line 5 of file Symbol.cpp.

References Ark::internal::Node::nodeType(), and Ark::internal::Symbol.

◆ MacroExecutor()

Ark::internal::MacroExecutor::MacroExecutor ( MacroProcessor * processor,
unsigned debug = 0 )
explicit

Construct a new Macro Executor object.

Parameters
processor
debug

Definition at line 37 of file Executor.cpp.


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