blob: 1ea30a8084e2bd406130dabbbb03520a8d26d76c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#pragma once
#include "Grammar.hpp"
namespace cru::parse {
class ParsingAlgorithmContext;
// Represents a parsing algorithm.
// It does not relate to any specific grammar.
// It is used to validate a grammar and create a parsing algorithm context.
class ParsingAlgorithm {
public:
ParsingAlgorithm() = default;
CRU_DELETE_COPY(ParsingAlgorithm)
CRU_DELETE_MOVE(ParsingAlgorithm)
~ParsingAlgorithm() = default;
virtual bool CanHandle(Grammar* grammar) const = 0;
virtual ParsingAlgorithmContext* CreateContext(Grammar* grammar) const = 0;
};
} // namespace cru::parse
|