ArkScript
A small, fast, functional and scripting language for video games
Pipeline.hpp
Go to the documentation of this file.
1/**
2 * @file Pipeline.hpp
3 * @author Ray John Alovera ([email protected]), Alexandre Plateau ([email protected])
4 * @brief The Chain of Responsibility class for running nodes through MacroExecutors
5 * @version 0.4
6 * @date 2021-05-04
7 *
8 * @copyright Copyright (c) 2021-2024
9 *
10 */
11
12#ifndef COMPILER_MACROS_PIPELINE_HPP
13#define COMPILER_MACROS_PIPELINE_HPP
14
15#include <vector>
16
18
19namespace Ark::internal
20{
21 class MacroProcessor;
22
23 /**
24 * @brief The class that initializes the MacroExecutors
25 *
26 */
28 {
29 public:
31
32 /**
33 * @brief Construct a new Macro Executor Pipeline object
34 *
35 * @param executors
36 */
37 explicit MacroExecutorPipeline(const std::vector<std::shared_ptr<MacroExecutor>>& executors);
38
39 /**
40 * @brief Passes node through all MacroExecutors sequentially
41 *
42 * @param node node on which to operate
43 * @return true if a macro was applied
44 * @return false
45 */
46 bool applyMacro(Node& node) const;
47
48 private:
49 std::vector<std::shared_ptr<MacroExecutor>> m_executors;
50 };
51}
52
53#endif
The base class for all MacroExecutors.
The class that initializes the MacroExecutors.
Definition: Pipeline.hpp:28
std::vector< std::shared_ptr< MacroExecutor > > m_executors
Definition: Pipeline.hpp:49
bool applyMacro(Node &node) const
Passes node through all MacroExecutors sequentially.
Definition: Pipeline.cpp:9
A node of an Abstract Syntax Tree for ArkScript.
Definition: Node.hpp:30