split ast definitions into more files
Also move pathToString definitions into the new files
Change-Id: I08b92ed108392825ec87af1f2b8a49205265dd47
diff --git a/src/parser.cpp b/src/parser.cpp
index f26b164..e2d0330 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -5,7 +5,6 @@
* Written by Václav Kubernát <kubervac@fit.cvut.cz>
*
*/
-#include <experimental/iterator>
#include <ostream>
#include "parser.hpp"
@@ -19,28 +18,6 @@
{
}
-struct nodeToDataString : public boost::static_visitor<std::string> {
- std::string operator()(const listElement_& node) const
- {
- std::ostringstream res;
- res << node.m_name + "[";
- std::transform(node.m_keys.begin(), node.m_keys.end(),
- std::experimental::make_ostream_joiner(res, ' '),
- [] (const auto& it) { return it.first + "=" + it.second; });
- res << "]";
- return res.str();
- }
- std::string operator()(const nodeup_&) const
- {
- return "..";
- }
- template <class T>
- std::string operator()(const T& node) const
- {
- return node.m_name;
- }
-};
-
command_ Parser::parseCommand(const std::string& line, std::ostream& errorStream)
{
command_ parsedCommand;
@@ -74,10 +51,5 @@
std::string Parser::currentNode() const
{
- std::string res;
- for (const auto& it : m_curDir.m_nodes) {
- res = joinPaths(res, boost::apply_visitor(nodeToDataString(), it));
- }
-
- return res;
+ return pathToDataString(m_curDir);
}