ArkScript
A small, fast, functional and scripting language for video games
Conditional.hpp
Go to the documentation of this file.
1/**
2 * @file Conditional.hpp
3 * @author Ray John Alovera ([email protected]), Alexandre Plateau ([email protected])
4 * @brief Executor for Conditional Macros
5 * @version 1.1
6 * @date 2021-05-04
7 *
8 * @copyright Copyright (c) 2021-2024
9 *
10 */
11
12#ifndef MACROS_EXECUTORS_CONDITIONAL_HPP
13#define MACROS_EXECUTORS_CONDITIONAL_HPP
14
17
18namespace Ark::internal
19{
20 /**
21 * @brief Handles Conditional macros
22 *
23 */
25 {
26 public:
28
29 /**
30 *
31 * @param node
32 * @param depth depth of the macro processor evalution
33 * @return true if the applying worked
34 */
35 bool applyMacro(Node& node, unsigned depth) override;
36
37 /**
38 *
39 * @param node
40 * @return true if the executor can handle the given node
41 */
42 [[nodiscard]] bool canHandle(Node& node) override;
43 };
44
45}
46
47#endif
The base class for all MacroExecutors.
AST node used by the parser, optimizer and compiler.
Handles Conditional macros.
bool applyMacro(Node &node, unsigned depth) override
bool canHandle(Node &node) override
A class that applies macros in a Node.
Definition Executor.hpp:29
MacroExecutor(MacroProcessor *processor, unsigned debug=0)
Construct a new Macro Executor object.
Definition Executor.cpp:7
A node of an Abstract Syntax Tree for ArkScript.
Definition Node.hpp:31