summaryrefslogtreecommitdiffhomepage
path: root/bnf.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-03-14 17:10:23 +0100
committerRoland Reichwein <mail@reichwein.it>2020-03-14 17:10:23 +0100
commit3a7006fcf5f8ecffd852fbba6d8ee03ce8a35dce (patch)
tree5bec440600e9de3b367d41345089e544a8fa791c /bnf.cpp
parent15a56fcb5f29b8507298144a835a819de652e788 (diff)
Remove dfa again
Diffstat (limited to 'bnf.cpp')
-rw-r--r--bnf.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/bnf.cpp b/bnf.cpp
index 7290962..4dd896e 100644
--- a/bnf.cpp
+++ b/bnf.cpp
@@ -1,8 +1,8 @@
#include "bnf.h"
-std::map<std::string, std::set<std::string>> Reverse(BNF bnf)
+std::unordered_map<std::string, std::set<std::string>> Reverse(BNF bnf)
{
- std::map<std::string, std::set<std::string>> result;
+ std::unordered_map<std::string, std::set<std::string>> result;
for (const auto& [from, to] : bnf) {
for (const auto& list : to) {
@@ -19,9 +19,9 @@ std::map<std::string, std::set<std::string>> Reverse(BNF bnf)
return result;
}
-std::map<std::string, std::set<std::string>> reverseFirst(BNF bnf)
+std::unordered_map<std::string, std::set<std::string>> reverseFirst(BNF bnf)
{
- std::map<std::string, std::set<std::string>> result;
+ std::unordered_map<std::string, std::set<std::string>> result;
for (const auto& [from, to] : bnf) {
for (const auto& list : to) {