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.3
6 * @date 2021-05-04
7 *
8 * @copyright Copyright (c) 2021
9 *
10 */
11
12#ifndef COMPILER_MACROS_PIPELINE_HPP
13#define COMPILER_MACROS_PIPELINE_HPP
14
15#include <vector>
16#include <memory>
17
19
20namespace Ark::internal
21{
22 class MacroProcessor;
23
24 /**
25 * @brief The class that initializes the MacroExecutors
26 *
27 */
29 {
30 public:
32
33 /**
34 * @brief Construct a new Macro Executor Pipeline object
35 *
36 * @param executors
37 */
38 MacroExecutorPipeline(const std::vector<std::shared_ptr<MacroExecutor>>& executors);
39
40 /**
41 * @brief Passes node through all MacroExecutors sequentially
42 *
43 * @param node node on which to operate
44 * @return true if a macro was applied
45 * @return false
46 */
47 bool applyMacro(Node& node);
48
49 private:
50 std::vector<std::shared_ptr<MacroExecutor>> m_executors;
51 };
52}
53
54#endif
The base class for all MacroExecutors.
The class that initializes the MacroExecutors.
Definition: Pipeline.hpp:29
bool applyMacro(Node &node)
Passes node through all MacroExecutors sequentially.
Definition: Pipeline.cpp:9
std::vector< std::shared_ptr< MacroExecutor > > m_executors
Definition: Pipeline.hpp:50
A node of an Abstract Syntax Tree for ArkScript.
Definition: Node.hpp:29