From 3a7006fcf5f8ecffd852fbba6d8ee03ce8a35dce Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sat, 14 Mar 2020 17:10:23 +0100 Subject: Remove dfa again --- grammer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'grammer.cpp') diff --git a/grammer.cpp b/grammer.cpp index be01adc..2379e9a 100644 --- a/grammer.cpp +++ b/grammer.cpp @@ -365,9 +365,9 @@ void Compiler::TrackBack() // breadth-first search // return: node, child -std::map Compiler::traverse(const std::string& lower, const std::string& upper) +std::unordered_map Compiler::traverse(const std::string& lower, const std::string& upper) { - std::map visited; // node, child + std::unordered_map visited; // node, child std::deque> todo{{lower, ""}}; // node, child while (!todo.empty()) { @@ -401,7 +401,7 @@ std::vector Compiler::GetPath(std::string upper, std::string lower) std::vector result; // traverse bnf from lower to upper - std::map visited {traverse(lower, upper)}; + std::unordered_map visited {traverse(lower, upper)}; auto current {upper}; while (current != lower) { -- cgit v1.2.3