blob: 9244b4d239d820a91735f0517f6ac9363a14967c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#pragma once
#include <deque>
#include <unordered_map>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std::string_literals;
using BNF = std::unordered_map<std::string, std::vector<std::vector<std::string>>>;
std::unordered_map<std::string, std::set<std::string>> Reverse(BNF bnf); // unused now, remove?
std::unordered_map<std::string, std::set<std::string>> reverseFirst(BNF bnf);
BNF SubBNF(const BNF& bnf, const std::string& top);
bool isTerminal(const BNF& bnf, const std::string& symbol);
|