Make parser template class

This commit is contained in:
IlyaShurupov 2023-11-06 15:43:31 +03:00 committed by Ilya Shurupov
parent 419ebb43d1
commit b3e5bf0941
9 changed files with 50 additions and 94 deletions

View file

@ -3,16 +3,17 @@
#include "AST.hpp"
#include "GrammarCompiler.hpp"
#include "Sentence.hpp"
namespace tp {
template <typename tAlphabetType>
class Parser {
public:
Parser() = default;
public:
void compileTables(const ContextFreeGrammar& cfGrammar, const RegularGrammar& reGrammar);
void parse(const Sentence& sentence, AST& out);
void compileTables(const ContextFreeGrammar& cfGrammar, const RegularGrammar<tAlphabetType, ualni>& reGrammar) {}
void parse(const tAlphabetType* sentence, ualni sentenceLength, AST& out) {}
public:
// save load compiled tables