blob: 87f464dd3de9107afabbdacc956f1e52d49e66dd [file] [log] [blame]
Václav Kubernát8cd63422018-03-19 17:10:13 +01001/*
2 * Copyright (C) 2018 CESNET, https://photonics.cesnet.cz/
Václav Kubernátd6662962018-03-22 17:41:33 +01003 * Copyright (C) 2018 FIT CVUT, https://fit.cvut.cz/
Václav Kubernát8cd63422018-03-19 17:10:13 +01004 *
5 * Written by Václav Kubernát <kubervac@fit.cvut.cz>
6 *
7*/
8#include "ast.hpp"
Václav Kubernátb96eef72018-05-04 19:10:22 +02009
10InvalidKeyException::~InvalidKeyException() = default;
11
Václav Kubernátd6662962018-03-22 17:41:33 +010012container_::container_(const std::string& name)
13 : m_name(name)
Václav Kubernát8cd63422018-03-19 17:10:13 +010014{
Václav Kubernát8cd63422018-03-19 17:10:13 +010015}
16
Václav Kubernátd6662962018-03-22 17:41:33 +010017bool container_::operator==(const container_& b) const
Václav Kubernát8cd63422018-03-19 17:10:13 +010018{
Václav Kubernátd6662962018-03-22 17:41:33 +010019 return this->m_name == b.m_name;
Václav Kubernát8cd63422018-03-19 17:10:13 +010020}
21
Václav Kubernátb96eef72018-05-04 19:10:22 +020022listElement_::listElement_(const std::string& listName, const std::map<std::string, std::string>& keys)
23 : m_listName(listName)
24 , m_keys(keys)
25{
26}
27
28bool listElement_::operator==(const listElement_& b) const
29{
30 return (this->m_listName == b.m_listName && this->m_keys == b.m_keys);
31}
32
Václav Kubernátd6662962018-03-22 17:41:33 +010033bool path_::operator==(const path_& b) const
Václav Kubernát8cd63422018-03-19 17:10:13 +010034{
Václav Kubernátd6662962018-03-22 17:41:33 +010035 if (this->m_nodes.size() != b.m_nodes.size())
36 return false;
37 return this->m_nodes == b.m_nodes;
38}
Václav Kubernát8cd63422018-03-19 17:10:13 +010039
Václav Kubernátd6662962018-03-22 17:41:33 +010040bool cd_::operator==(const cd_& b) const
41{
42 return this->m_path == b.m_path;
43}
44
45
46ParserContext::ParserContext(const CTree& tree)
47 : m_tree(tree)
48{
49 m_curPath = m_tree.currentNode();
Václav Kubernát8cd63422018-03-19 17:10:13 +010050}