aboutsummaryrefslogtreecommitdiff
path: root/include/cru/parse/ParsingAlgorithmContext.hpp
blob: 072203ecd7c076ec2a67bcc8d44105b4ceb01d8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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