aboutsummaryrefslogtreecommitdiff
path: root/include/cru/parse/ParsingAlgorithmContext.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/parse/ParsingAlgorithmContext.hpp')
-rw-r--r--include/cru/parse/ParsingAlgorithmContext.hpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/cru/parse/ParsingAlgorithmContext.hpp b/include/cru/parse/ParsingAlgorithmContext.hpp
new file mode 100644
index 00000000..072203ec
--- /dev/null
+++ b/include/cru/parse/ParsingAlgorithmContext.hpp
@@ -0,0 +1,23 @@
+#pragma once
+#include "Grammar.hpp"
+
+namespace cru::parse {
+class ParsingAlgorithm;
+
+// A parsing algorithm context contains all data a parsing algorithm needs to
+// parse for a grammar. It does not relate to any input. For example, it can
+// contain any state machine.
+class ParsingAlgorithmContext {
+ public:
+ ParsingAlgorithmContext(Grammar* grammar, ParsingAlgorithm* algorithm);
+
+ CRU_DELETE_COPY(ParsingAlgorithmContext)
+ CRU_DELETE_MOVE(ParsingAlgorithmContext)
+
+ ~ParsingAlgorithmContext();
+
+ private:
+ Grammar* grammar_;
+ ParsingAlgorithm* algorithm_;
+};
+} // namespace cru::parse