blob: 9b1210c0bd73eda2ff6d2ffa70420787c8192bf1 [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át0a2a2e82018-05-11 13:59:12 +02009#include "ast_handlers.hpp"
Václav Kubernátb96eef72018-05-04 19:10:22 +020010
11InvalidKeyException::~InvalidKeyException() = default;
12
Václav Kubernátd6662962018-03-22 17:41:33 +010013container_::container_(const std::string& name)
14 : m_name(name)
Václav Kubernát8cd63422018-03-19 17:10:13 +010015{
Václav Kubernát8cd63422018-03-19 17:10:13 +010016}
17
Václav Kubernátd6662962018-03-22 17:41:33 +010018bool container_::operator==(const container_& b) const
Václav Kubernát8cd63422018-03-19 17:10:13 +010019{
Václav Kubernátd6662962018-03-22 17:41:33 +010020 return this->m_name == b.m_name;
Václav Kubernát8cd63422018-03-19 17:10:13 +010021}
22
Václav Kubernátb96eef72018-05-04 19:10:22 +020023listElement_::listElement_(const std::string& listName, const std::map<std::string, std::string>& keys)
24 : m_listName(listName)
25 , m_keys(keys)
26{
27}
28
29bool listElement_::operator==(const listElement_& b) const
30{
31 return (this->m_listName == b.m_listName && this->m_keys == b.m_keys);
32}
33
Václav Kubernátd6662962018-03-22 17:41:33 +010034bool path_::operator==(const path_& b) const
Václav Kubernát8cd63422018-03-19 17:10:13 +010035{
Václav Kubernátd6662962018-03-22 17:41:33 +010036 if (this->m_nodes.size() != b.m_nodes.size())
37 return false;
38 return this->m_nodes == b.m_nodes;
39}
Václav Kubernát8cd63422018-03-19 17:10:13 +010040
Václav Kubernátd6662962018-03-22 17:41:33 +010041bool cd_::operator==(const cd_& b) const
42{
43 return this->m_path == b.m_path;
44}
45
46
47ParserContext::ParserContext(const CTree& tree)
48 : m_tree(tree)
49{
50 m_curPath = m_tree.currentNode();
Václav Kubernát8cd63422018-03-19 17:10:13 +010051}