From 360a3bdbc9cf7084d9f1f1af09ea99831edffd34 Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 15 Dec 2021 21:11:26 +0800 Subject: ... --- include/cru/parse/ParsingAlgorithmContext.hpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 include/cru/parse/ParsingAlgorithmContext.hpp (limited to 'include/cru/parse/ParsingAlgorithmContext.hpp') 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 -- cgit v1.2.3